Brain-Teaser 37: Which page?
From The Sunday Times, 3rd December 1961 [link]
A student desiring to find a reference in a book, could not remember the actual page number, but only the three figures comprising it.
Before beginning his search, he wrote down in ascending order the six possible variants of the three figures. In writing the second variant his pencil broke on
a figure which thereafter was illegible. With a fresh pencil he completed the list of variants and then found his reference, the page number being the second variant.Some time later he found in his pocket the scrap of paper bearing the six numbers. Idly adding them he obtained a total of 4,796, having unwittingly misread the illegible figure.
On what page was the reference?
This puzzle is included in the book Sunday Times Brain Teasers (1974).
This puzzle was originally published with no title.
[teaser37]
Jim Randell 10:29 am on 27 June 2021 Permalink |
If he had written out each of the 6 numbers correctly (the digits being a, b, c), then each digit would appear twice in each position so the total sum of the six numbers would be:
If the misinterpreted digit is off by x then the total sum is off by 100x if the first digit of the number is misinterpreted, 10x if its the second digit, and x if its the final digit.
This Python program runs in 49ms.
Run: [ @replit ]
from enigma import (irange, subsets, div, nconcat, printf) M = 4796 # mistaken total # check to see if "abc" can be misread by d def check(a, b, c, d): # error in hundreds position? (a) x = div(abs(d), 100) if x: return 0 < (a + x if d > 0 else a - x) < 10 # error in tens position? (b) x = div(abs(d), 10) if x: return 0 < (b + x if d > 0 else b - x) < 10 # error in units position? (c) return 0 < (c + d) < 10 # consider possible digits in the number for (a, b, c) in subsets(irange(1, 9), size=3): # the total sum should be... T = 222 * (a + b + c) # and the difference from the calculated sum d = M - T # digits of the 2nd number in the list are a, c, b if d != 0 and check(a, c, b, d): n = nconcat(a, c, b) printf("reference = {n} [read as {m}]", m=n + d)Solution: The reference was on page 198.
So the sum of the numbers should have been 3996, but the second number was read as 998, adding 800 to the sum.
LikeLike
Frits 10:22 am on 12 August 2025 Permalink |
from enigma import SubstitutedExpression M = 4796 # mistaken total vars = "ABC" # i * j = difference with respect to the correct number for i in range(-9, 10): if not i: continue for k, j in enumerate([100, 10, 1]): t, r = divmod(M - i * j, 222) if r: continue sum_ABC = str((M - i * j) // 222) # illegible figure may also have been a zero if idly adding them extra = "0 <= " + vars[k] + " + " + str(i) + " < 10" # digits of the 2nd number in the list are a, c, b p1 = SubstitutedExpression(["C < B", sum_ABC + " - B - C = A", extra, "A < C"], answer="ABC", digits=range(1, 10), reorder=0, verbose=0) # solve the first alphametic for ans in p1.answers(): print("answer:", ans)LikeLike