From The Sunday Times, 3rd May 1981 [link]
People often ask me how I first got involved with setting teasers, and the answer is rather interesting. A friend suggested that I should like to visit a medium, who, with spiritual help, would give me some advice for the future. He said that he knew a jolly woman who would probably be able to suggest an exciting change in my career (I thought it more likely that I’d strike a happy medium).
Anyway, I went along, and found that this medium had an unusual ouija board. It consisted of 24 points equally spaced around the perimeter of a circle. She invited me to write a letter of the alphabet against each of these points. Some letters were used more than once, and some (of course) were not used at all.
Then, after much concentration, a counter moved from the centre of the circle straight to a letter. It paused, and then went straight to another letter, and so on. When it had completed a word, it went straight back to the centre of the circle, paused, and then started the next word in the same way.
There were two fascinating things about the message that it spelt out for me. The first was that, each time the counter moved, it moved an exact whole number of inches. The second was that it spelt out the message:
SET
A
SUNDAY
TIMES
BRAIN
TEASER
IN
???
The last bit consisted of three letters which were the first three letters of a month.
Which month?
This puzzle is included in the book The Sunday Times Book of Brainteasers (1994).
[teaser980]
Jim Randell 9:02 am on 2 April 2024 Permalink |
The total of the numbers from 1 to 25 is 325. So the magic constant is 325/5 = 65.
We can solve the puzzle using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 91ms. (Internal runtime of the generated program is 4.1ms).
Run: [ @replit ]
And here is a wrapper that assembles the required answer(!).
from enigma import (SubstitutedExpression, rev, join, printf) # load the alphametic puzzle p = SubstitutedExpression.from_file("teaser2614.run") # solve it for s in p.solve(verbose=0): r = rev(s) # output solution vs = [11, 9, 7, 3, 23, 22] printf("{vs} -> {ks}", ks=join(r[v] for v in vs))Solution: The given values spell: ANSWER.
The grid looks like this:
And the letters ordered by value are:
LikeLike
Frits 10:59 am on 2 April 2024 Permalink |
@Jim, 5th column equation is same as 5th row equation.
LikeLike
Jim Randell 11:13 am on 2 April 2024 Permalink |
Thanks. Fixed now.
I did make a version of the code that derives the expressions from the rows of the square [@replit] (which eliminates mistakes like this), but I posted the literal version as it is more readable.
LikeLike
GeoffR 2:22 pm on 2 April 2024 Permalink |
LikeLike
Frits 6:09 pm on 3 April 2024 Permalink |
# make sure loop variable value is not equal to previous ones def domain(v, r=range(1, 26)): # find already used loop values ... vals = set() # ... by accessing previously set loop variable names i = 0 # initially <i> (otherwise compiler error) for i, s in enumerate(lvd[v], 1): val = globals()[s] # general domain check if not (0 < val < 26): return [] vals.add(val) # don't except duplicates in previous variables if len(vals) != i: return [] return [x for x in r if x not in vals] # set up dictionary of for-loop variables lv = list("NXSUDAYTIMGEQVWBCLOKJFHPR") lvd = {v: lv[:i] for i, v in enumerate(lv)} # D + I + N + S = (N + 1) + (N + 5) + N + (N - 2) = 4N + 4 --> X = 61 - 4N for N in domain('N', range(9, 16)): X = 61 - 4 * N S, U, N, D, A, Y, T, I, M = [N + x for x in range(-2, 7)] G = 65 - (A + M + S + Y) # E + I + M + Q + U = 65, E = 65 - Q - (I + M + U) and E > M # assume E = M + x, x > 0 --> x = 65 - Q - (I + 2M + U) > 0 if (I + 2 * M + U) > 63: continue # check rest of numbers for E in domain('E', range(M + 1, 26)): Q = 65 - (E + I + M + U) for V in domain('V'): W = 65 - (U + V + X + Y) for B in domain('B'): C = 65 - (A + B + D + E) L = 65 - (B + G + Q + V) for O in domain('O'): K = 65 - (L + M + N + O) J = 65 - (E + O + T + Y) for F in domain('F'): H = 65 - (F + G + I + J) P = 65 - (A + F + K + U) for R in domain('R'): if R != 65 - (P + Q + S + T): continue # check remaining equations to be sure we give a correct answer if P + Q + R + S + T != 65: continue if C + H + M + R + W != 65: continue vs = [11, 9, 7, 3, 23, 22] nums = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y] chars = "ABCDEFGHIJKLMNOPQRSTUVWXY" print(f"answer: {[chars[nums.index(v)] for v in vs]}")LikeLike
Frits 8:39 pm on 3 April 2024 Permalink |
line 30 also implies that N is less than 12.
LikeLike