From New Scientist #2693, 31st January 2009 [link] [link]
Before being the youngest member of the British team at the 2008 Beijing Olympics, Tom Daley had become the youngest European diving champion on record by winning the individual title from the 10-metre platform board while still aged only 13.
So it is appropriate that I can offer this puzzle:
TOM × 13 = DALEY
Each letter stands for a different digit, and no number starts with a zero.
What is the five-digit number represented by DALEY?
[enigma1530]
This one is easy to brute force. Here’s my original Perl code. It runs in 9ms.
Solution: DALEY = 10348.
A similar thing in Python. It runs in 40ms.
And here’s a Python version using the
SubstitutedSum
class from the enigma.py library. It also runs in 40ms.I used this puzzle as one of the examples for developing the [[
SubstitutedExpression
]] solver in the enigma.py library. (See: Solving Alphametics with Python).A puzzle like this can be solved directly from the command line:
The command runs in 64ms. The internal runtime of the generated program is 281µs.
The answer will be ready when you click on enter key
if you write the expression TOM*13=DALEY
on the site http://www.iread.it/cryptarithms.php
in the section Cryptarithms Solve
The answer will be seen as
M Y T O D A L E
6 8 7 9 1 0 3 4
Another solution.
As this thread came to life again a few months ago, I don’t feel too uncomfortable about posting this snippet in from Google Apps Script.
@NJF: Is there an easy way to run scripts like this?
Ah. I found if I replaced
Logger.log
withprint
then I could run the script usingjsc
, which is already on my system.Or replacing it with
console.log
I can usenode
.(And I made
TOM
go up in steps of 1 instead of 13).This problem is actually simple enough for a paper & pencil approach.
Establishing bounds for TOM is trivial: the values must lie between 770 to 978 and be exactly divisible by 13. There are only 18 of these and you can strike out 7 of them for not having unique digits. By inspection, the 11 corresponding values of DALEY can quickly be reduced to 4 with unique digits and only 1 where the digits of TOM and DALEY are all unique.
It took me longer to write this post than to find the solution 🙂
Apologies, I misspoke: it’s the DALEY value which must be exactly divisible by 13, from which we derive the TOM values. More haste, less speed !!