From The Sunday Times, 17th August 1980 [link]
There are three teams In the Midchester football league: Albion, United and Victoria. During the season they play each other twice; once at home and once away.
A team gets two points for a win and one point tor a draw. After each match the local paper publishes the current league table. In this table the teams are listed according to points and if two or more teams have equal points then they are listed according to goal difference, (i.e. “goals for” minus “goals against”). If two or more teams have equal points and equal goal difference then they are listed alphabetically.
At the end of last season the sports editor published the results of all the matches:
Albion 4 – United 0
Albion 0 – Victoria 0
United 0 – Albion 1
United 2 – Victoria 0
Victoria 3 – Albion 0
Victoria 1 – United 2
He also said that each of the six league tables published during the season had put the teams in a different order. Thus each of the six possible orders of the teams (AUV, AVU, UAV, UVA, VAU, VUA) had occurred in one of the six league tables. Finally, he said that the third match of the season had been the draw, A vs. V.
List the six matches in the order in which they were played during the season.
This puzzle is included in the book The Sunday Times Book of Brainteasers (1994).
[teaser943]
Jim Randell 5:50 am on 12 July 2026 Permalink |
If the front of the tenth card has a value of X, and the sum of the numbers on each card is N, then, by considering the total of the fronts and backs, we have:
Hence X is a multiple of 5.
The following Python program runs in 63ms. (Internal runtime is 87µs).
from enigma import (defaultdict, irange, inf, union, is_prime, ordered, singleton, printf) # the numbers on the front of the first 9 cards front = [2, 15, 17, 21, 24, 31, 35, 36, 44] # collect candidate solutions (= card 10) by the total number of primes rs = defaultdict(set) # consider the front of card 10 (= X) for X in irange(5, inf, step=5): if X in front: continue # determine the total for each card N = 45 + (X // 5) # and the back of card 10 (= Y) Y = N - X if Y < 1: break # the numbers on the back of the first 9 cards back = list(N - x for x in front) # the numbers on the cards are all different ns = union([front, back, (X, Y)]) if len(ns) != 20: continue # count the primes P = sum(1 for n in ns if is_prime(n)) # collect candidate solution printf("[X={X} N={N} -> {front} / {back} + [{X} / {Y}] -> {P} primes]") rs[P].add(ordered(X, Y)) # look for unique solutions for (k, vs) in rs.items(): v = singleton(vs) if v is not None: printf("{k} primes -> card 10 = {v}")If you are running under Python 3 you can use the following at line 23 to collect all the numbers into a
set:ns = { X, Y, *front, *back }Solution: The numbers on the tenth card are 9 and 45.
The cards are ((front, back), primes underlined):
The numbers on each card sum to 54, and the total of the fronts is 270 and the total of the backs is also 270.
The are two other candidate sets of cards that can be constructed, but they each have 7 primes:
LikeLike
Frits 11:20 am on 12 July 2026 Permalink |
from collections import defaultdict # front nine cards f9 = {2, 15, 17, 21, 24, 31, 35, 36, 44} # sum = 225 sumf9 = sum(f9) # primes in range 2 to (sum(f9) - 1) // 4 - 1 P = {3, 5, 7} P |= {2} | {x for x in range(11, (sum(f9) - 1) // 4, 2) if all(x % p for p in P)} d = defaultdict(list) # b = sum(f9) - 4 * t2 >= 1 or t2 <= (sum(f9) - 1) / 4 # possible totals of the integers on a card for t2 in range(max(f9) + min(set(range(1, max(f9) + 2)) - f9), (sumf9 - 1) // 4 + 1): # calculate front of the 10th card f = 5 * t2 - sumf9 if f in f9: continue f10 = f9 | {f} b10 = {t2 - n for n in f10} # 20 different positive integers if len(fb10 := f10 | b10) != 20: continue # store the 20 numbers for the number of prime numbers d[sum(n in P for n in fb10)] += [(t2, fb10)] # look for a unique solution for k, vs in d.items(): if len(vs) == 1: t, ns = vs[0] print(f"answer: {sorted(ns - f9 - {t - n for n in f9})}")LikeLike
Ruud 5:27 pm on 12 July 2026 Permalink |
import collections import types import istr collect = collections.defaultdict(list) first_nine_cards_front = [2, 15, 17, 21, 24, 31, 35, 36, 44] for sum_on_card in range(45, 100): for card10_front in range(1, 100): if card10_front in first_nine_cards_front: continue cards_front = first_nine_cards_front + [card10_front] cards_back = [] for card_front in cards_front: card_back = sum_on_card - card_front if card_back < 1 or card_back in cards_front + cards_back: break cards_back.append(card_back) else: if sum(cards_front) == sum(cards_back): number_of_primes = sum(filter(istr.is_prime, cards_front + cards_back)) collect[number_of_primes].append(types.SimpleNamespace(cards_front=cards_front, cards_back=cards_back)) for solutions in collect.values(): if len(solutions) == 1: print(solutions[0]) print("card10:", sorted([solutions[0].cards_front[-1], solutions[0].cards_back[-1]]))LikeLike