Teaser 2451: [Just one out]
From The Sunday Times, 13th September 2009 [link]
I have just typed a product, but my machine gives a display that is “just one out”:
3 × 6 = 19
Whenever I type a digit, it displays a digit one more or less than the one I intended. So you should realise that I was trying to type:
4 × 7 = 28
I have tried again with another product, and again the display shows one digit times another higher digit equalling a two-figure prime answer that appears to be just one out.
This time if I showed you the display it would be impossible for you to work out the product I was trying to type.
What is the display this time?
This puzzle was originally published with no title.
[teaser2451]
Jim Randell 7:41 am on 17 March 2026 Permalink |
I have assumed that digits do not “wrap around”, and so if “0” is typed the machine always replaces it with “1”. And if “9” is typed the machine always replaces it with “8”.
This Python program runs in 75ms. (Internal runtime is 744µs).
from enigma import (defaultdict, irange, subsets, cproduct, is_prime, sprintf as f, join, printf) # possible incorrect digits ds = { 0: [1], 1: [0, 2], 2: [1, 3], 3: [2, 4], 4: [3, 5], 5: [4, 6], 6: [5, 7], 7: [6, 8], 8: [7, 9], 9: [8], } # collect candidate inputs by possible output rs = defaultdict(list) # choose an input sum: a * b = xy for (a, b) in subsets(irange(1, 9), size=2): xy = a * b (x, y) = divmod(xy, 10) if x == 0: continue # can we adjust all the digits by 1 to give a result that is off by one? for (a_, b_, x_, y_) in cproduct(ds[k] for k in (a, b, x, y)): if x_ == 0: continue xy_ = 10*x_ + y_ if abs(a_ * b_ - xy_) == 1 and is_prime(xy_): (expr, expr_) = (f("{a} * {b} = {xy}"), f("{a_} * {b_} = {xy_}")) rs[expr_].append(expr) printf("[{expr} -> {expr_}]") # look for ambiguous outputs for (k, vs) in rs.items(): if len(vs) > 1: printf("{k} <- {vs}", vs=join(vs, sep="; "))Solution: The display shows: “5 × 6 = 31”.
And there are two inputs that may lead to this display:
Note that in both these cases the digits are all changed in the same direction.
However, if we allow the digits to “wrap around” so that “0” could be replaced by “1” or “9”, and “9” could be replaced by “0” or “8”, then there are further possible displays that have ambiguous origins:
And these require that some digits in the expression are moved up and some moved down.
LikeLike