**From New Scientist #1409, 10th May 1984** [link]

I thought of an integer, added 1 and multiplied the total by the number I’d first thought of. I added 1 and multiplied the total by the number I’d first thought of. I added 1 and multiplied the total by the number I’d first thought of. Then I added 1. The final total was a perfect square. What is more, if I told you what that square was, then you’d be able to deduce the number I first thought of.

What *was* the number I first thought of?

**Enigma 52** and **Enigma 147** are also called “Think of a number”.

[enigma262]

### Like this:

Like Loading...

The hard part of this problem is the analysis to limit the number of integers we need to consider:

The procedure followed, starting with integer

nis:Now consider:

writing

p = 4n^2 + 2n + 1:so:

also:

So for

n < -1orn > 3we have:i.e.

16 f(n)lies between 2 consecutive squares, so it cannot be a perfect square.Now suppose

f(n) = q^2for some integerq, then:But

16 f(n)cannot be a perfect square, hence neither canf(n).So we only need to explore values for n = -1, 0, 1, 2, 3, which we can do by hand or by program:

Solution:The number first thought of was 3.