Brain-Teaser 871: Space-age numbers
From The Sunday Times, 16th April 1978 [link]
My son has just learnt to recognise numbers and so he takes great interest in my calculator, even though the numbers are straightened-up electronic versions of the ones he’s used to.
I entered a large number on the calculator to show my son. Then there was great excitement as he noticed the reflection of the calculator in a mirror.
“Look Dad, that calculator in there has also got a number on it, and it’s different from yours”, he exclaimed (and he was right.
Then I used the calculator to divide the number I’d just put in by three. The answer was a five-digit whole number in which each of the five digits was different. This time my son remarked: “Hey Dad, when I hold the calculator upside-down I can see another five-digit number”; and again he was right.
I then used the calculator to work out the difference between the number in the calculator the right way up and the number my son had seen by holding the calculator upside-down. Again the answer was a five-digit number with all of its digits different. And yet again my son held the calculator upside-down and saw another number.
What number did he see this time?
This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981). Where it is noted that this is one of the earliest Teaser puzzles to involve a calculator.
The puzzle text above is taken from the book.
[teaser871]





Jim Randell 9:59 am on 11 September 2026 Permalink |
The set of reflected digits is different depending on whether they are reflected about a horizontal or vertical axis. The diagram in the solution given in the book shows the author was considering a vertical axis (left↔︎right)). Although if a horizontal axis (top↔︎botton) is used, the set of viable reflected digits is the same, with the addition of 3 → 3. However, if this alternative set of reflections is used the answer to the puzzle is the same).
The following Python solution starts by looking for a 5-digit number, consisting of 5 different digits that can be rotated to give a viable number. It then looks at the difference between these numbers, and checks that it is also a 5-digit rotatable number, with 5 different digits. And then it considers the original number in the puzzle, which is 3 times the number we started with, and checks to see if this is reflectable to give a different number. If all the conditions are met, the answer is the rotation of the calculated difference.
It runs in 87ms. (Internal runtime is 12.1ms)
from enigma import (subsets, nconcat, rev, nsplit, printf) # 7-segment display digits that can be reflected (horizontally) to give a valid digit refl = { 0: 0, 1: 1, 2: 5, 5: 2, 8: 8 } # 7-segment display digits that can be rotated to give a valid digit rot = { 0: 0, 1: 1, 2: 2, 5: 5, 6: 9, 8: 8, 9: 6 } # consider a rotatable number composed of 5 different digits for ds in subsets(rot.keys(), size=5, select='P'): if ds[0] == 0 or ds[-1] == 0: continue # construct the number, and its rotation n = nconcat(ds) r = nconcat(rot[d] for d in rev(ds)) # calculate the difference diff = abs(n - r) dds = nsplit(diff) # should be 5-digits all different if len(dds) != 5 or len(set(dds)) != 5: continue # and also rotatable rds = list(rot.get(d) for d in rev(dds)) if None in rds: continue # the original number is 3n n1 = 3 * n # the number is reflectable (to give a different number) r1ds = list(refl.get(d) for d in nsplit(n1, reverse=1)) if None in r1ds: continue r1 = nconcat(r1ds) if r1 == n1: continue # output solution rd = nconcat(rds) printf("first number = {n1} -> mirrored = {r1}") printf("second number = {n} -> rotated = {r}, diff = {diff} -> rotated = {rd}") printf()Solution: The final number seen by the son was 29601.
There are 3 possible starting numbers:
But, in each case the difference between the second number and its rotation is 10962, and when rotated this reads as 29601.
LikeLike
Ruud van der Ham 5:52 pm on 11 September 2026 Permalink |
I had to look up Jim’s solution o see that the differnce is actually between the upside-down mirror number and the original number and not -as the problem description says- between the original nmber and the upside-down number.
Here’s my solution:
import peek import istr def mirror(x): return istr.join(str({0: 0, 1: 1, 2: 5, 5: 2, 8: 8}.get(int(i), "x")) for i in reversed(x)) def upside_down(x): return istr.join(str({0: 0, 1: 1, 2: 2, 5: 5, 6: 9, 8: 8, 9: 6}.get(int(i), "x")) for i in reversed(x)) for n1 in istr.range(length=5): if n1.all_distinct(): n0 = 3 * n1 if "x" not in mirror(n0) and n0 != mirror(n0): if "x" not in upside_down(n1) and n1 != upside_down(n1): n2 = upside_down(n1) - n1 if n2 > 0 and len(n2) == 5 and n2.all_distinct(): if "x" not in upside_down(n2) and n2 != upside_down(n2): peek(n0, n1, n2, mirror(n0), upside_down(n1), upside_down(n2))LikeLike