### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,115)
- misc (2)
- project euler (2)
- puzzle (29)
- site news (43)
- tantalizer (29)
- teaser (3)

### Site Stats

- 166,357 hits

Programming Enigma Puzzles

21 December 2015

Posted by on **From New Scientist #2344, 25th May 2002** [link]

I was playing about with my seven-digit-display calculator, showing my numerate nephew a trick or two. I displayed a number on the calculator and he looked at it upside down. After some jottings of his own he declared “I can see a number too, and it’s a perfect square”.

I then doubled my original number and displayed the answer and again he looked at it upside down and did some calculations.

“I can still see a number, and it’s another perfect square”, he said.

Which number did I originally display?

[enigma1188]

Advertisements

%d bloggers like this:

This Python program runs in 53ms.

Solution:The original number was 9126 (the correct way up).9126 reads as 9216 (= 96²) when inverted.

9126 doubled is 18252, which reads as 25281 (= 159²) when inverted.

We ignore the trivial solution where all numbers are 0, because there is some calculation involved to determine if a number is a perfect square.