From The Sunday Times, 22nd March 2009 [link]
My grandson has learnt about 3 × 3 Magic Squares (tables of nine different positive whole numbers with each row of three, column of three and diagonal of three adding to the same sum). To illustrate, he placed 100 in the centre of a 3 × 3 table and 1 somewhere else in the table.
He asked me to choose any other number lower than 200 and said he would place it in the table and complete it to make a Magic Square.
This would have been possible for most numbers, but I unkindly chose my age, knowing the task would then be impossible.
How old am I?
This puzzle was originally published with no title.
This completes the archive of Teaser puzzles from 2009. There is now a complete archive of Teaser puzzles from January 2009 to the most recent puzzle published in July 2026 (this represents 916 puzzles), as well as 454 earlier Teaser puzzles.
[teaser2426]
Jim Randell 3:04 pm on 31 July 2026 Permalink |
Here is a straightforward solution using the [[
SubstitutedExpression]] solver from the enigma.py library.It runs in 78ms. (Internal runtime of the generated code is 1.4ms).
Or you can just call the solver directly from the command line:
Or we can keep the sum as an addition sum (as it is originally presented), and use the [[
SubstitutedExpression.split_sum]] solver on it.The following (slightly longer) run-file executes in 76ms. (Internal runtime of the generated code is 260µs).
Solution: NOW = 130.
LikeLike
Ruud 5:06 pm on 31 July 2026 Permalink |
import peek import istr for four in istr.range(length=4): twenty = 32 * four if len(twenty) == 6 and twenty[0] == twenty[4] and (twenty[1:] | four).all_distinct(): now = twenty[3] | four[1] | twenty[1] peek(now, four, twenty)LikeLike