### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,314)
- misc (3)
- project euler (2)
- puzzle (78)
- puzzle# (21)
- site news (54)
- tantalizer (80)
- teaser (7)

### Site Stats

- 217,165 hits

Programming Enigma Puzzles

19 April 2019

Posted by on **From New Scientist #2170, 23rd January 1999** [link]

Harry was playing about with his calculator and keyed in a 4-digit number. He placed a mirror behind and parallel to the display, and added the reflected number, which was smaller, to the number on the display. This gave him a 5-digit sum.

He then again keyed in the original number, and this time subtracted the reflection from it.

He divided the sum by the difference and found that the quotient was a 4-digit prime.

What was his original number?

[enigma1014]

%d bloggers like this:

This Python program runs in 100ms.

Run:[ @repl.it ]Solution:The original number was 8805.The reflected number is 8802. Giving a sum of 17607, and difference of 3. The quotient is 17607 / 3 = 5869.