Sunday Times Teaser 3312 – Never Ends Rumbas
by Colin Vout
Published Sunday March 15 2026
Whether or not Reverend Spooner really did accidentally swap over the sounds of initial bits of words (or wits of birds?) with amusing results, we might wonder if he did the same thing with numbers.
He might have prepared a list of all possible pairs of three-digit prime numbers, for which each pair became square numbers when the first digit of the first number was exchanged with the first digit of the second number. He might have put each pair of primes in numerical order, and might then have put the pairs overall in numerical order.
I’m not trying to start a rumour that this really happened. Like spoonerisms of words, this is just for amusement.
What would have been the list of the Reverend’s Numbers?
-
John Z. permalink123456789101112131415161718192021from itertools import combinations# three digit squaressq3 = tuple(x * x for x in range(10, 32))# three digit primesp12 = (3, 5, 7, 11, 13, 17, 19, 23, 29, 31)p3 = tuple(x for x in range(101, 1000, 2) if all(x % p for p in p12))# take pairs of primesfor pc2 in combinations(p3, 2):pp1 = divmod(pc2[0], 100)pp2 = divmod(pc2[1], 100)# does first digit exchange yield squares?if (pp1[0] * 100 + pp2[1]) in sq3 and (pp2[0] * 100 + pp1[1]) in sq3:print(pc2)# no additional sorting is needed as initial primes are already in order