### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,122 hits

Programming Enigma Puzzles

9 March 2018

Posted by on **From New Scientist #1589, 3rd December 1987** [link]

“How many perfect squares are there between TEN and TWENTY?”

“ONE.”

“Right. And are TWO, TEN, TWELVE and TWENTY even?”

“Of course. In fact the first and last digits of TWENTY are both even.”

“Right. And is TEN divisible by 3?”

“Of course not.”

In the above, digits have consistently been replaced by letters, different letters representing different digits.

FindÂ NOW.

[enigma439]

%d bloggers like this:

This Python program defines a function to calculate the number of perfect squares between two numbers, and then uses the [[

`SubstitutedExpression()`

]] solver from theenigma.pylibrary to solve the alphametic part of the problem. It runs in 81ms.Run:[ @repl.it ]Solution:NOW = 869.The assignment of letters to digits is:

There are two further solutions where TEN

isa multiple of 3: