Teaser 2445: [Divisible by 9]
From The Sunday Times, 2nd August 2009 [link]
I started with a list of six numbers (with no leading zeros, of course). Five of the six numbers were divisible by 9.
Then I coded the numbers by consistently using letters for digits, with different letters representing different digits.
In this way, the list became:
SETTER
SENT
PRETTY
EASY
SUNDAY
TEASERWhich of those words represented the number that was not divisible by 9?
This puzzle was originally published with no title.
[teaser2445]
Jim Randell 9:22 am on 1 May 2026 Permalink |
Here is a straightforward solution using the [[
SubstitutedExpression]] solver from the enigma.py library.It runs in 106ms. (Internal runtime of the generated code is 21ms).
Solution: TEASER is not divisible by 9.
There are 36 ways to assign the digits to the letters, but in all cases TEASER is the odd number out.
If the puzzle had been set so that just one of the words is not divisibly by 29, then there is a single way to assign digits to the letters.
LikeLike
Ruud 11:07 am on 1 May 2026 Permalink |
Brute force reveals that there are 36 different solutions, all resulting in TEASER to be the one that’s not divisible by 9.
import peek import istr count = 0 for s, e, t, r, n, p, y, a, u, d in istr.permutations(range(10)): if s * p * e * t: # may not start with 0 not_divisible_by_9 = "" for name in "setter sent pretty easy sunday teaser".split(): if not istr(f":={name}").is_divisible_by(9): if not_divisible_by_9: break not_divisible_by_9 = name else: if not_divisible_by_9: count += 1 peek(count, not_divisible_by_9, setter, sent, pretty, easy, sunday, teaser)LikeLike