### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

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

### Site Stats

- 168,282 hits

Programming Enigma Puzzles

20 March 2013

Posted by on **From New Scientist #2909, 23rd March 2013** [link]

I have before me five two-digit numbers, with no leading zeros. All the digits are different and none of the numbers is prime. The sum of the five numbers is a perfect square. If I remove one of the numbers, the sum of the remaining four is also a perfect square. If I remove another number, the sum of the remaining three is again a perfect square, and if I remove a third number, the sum of the last two is again a perfect square.

What are my five numbers?

[enigma1741]

Advertisements

%d bloggers like this:

This Python program solves the problem recursively in 56ms.

Solution:The five numbers are 10, 39, 72, 48, 56.A solution using the permutations approach:

Here is my version. There are at most 15 squares so its quicker to work with these rather than the numbers themselves.

An interesting approach. Here’s my take on it.

I also rewrote it in a similar way to make it shorter:

And here’s a recursive version.

Mine is a similar idea to Brian’s :

Here is another programme solution for Enigma 1471