### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,972 hits

Advertisements

Programming Enigma Puzzles

30 January 2012

Posted by on **From New Scientist #1182, 22nd November 1979** [link]

“Since last year”, said Mr Knull, “when I read in M500/52 of a puzzle which its proposer John Hulbert described as a ‘glorious time waster’, I have been struggling with two versions of it. I wonder if you can help me with the easier version? It is quite simple to state. Find three different integers,

P, QandR,such thatP+Q, P+R, Q+R, P−Q, P−R,andQ−Rare all perfect squares. Any questions?”“Just one”, I said. “Is 0 an integer? I always forget.”

“Of course it is”, said Mr Knull. “And so of course are −1, −2 and so on”.

What is the smallest such set of three different integers you can find? By

smallestI mean withP+Q+Ras small as possible.

This puzzle is revisited in **Enigma 45**.

[enigma40]

Advertisements

%d bloggers like this:

Having previously solved

Enigma 45, this is a simple modification. You just need to remove the condition thatR > 0. Although having said that I probably wouldn’t have come up with a solution that was as efficient if I hadn’t tackledEnigma 45.This program runs in 36ms.

Solution:P = 17, Q = 8, R = −8, P + Q + R = 17.