### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,176)
- misc (2)
- project euler (2)
- puzzle (44)
- site news (46)
- tantalizer (48)
- teaser (3)

### Site Stats

- 183,172 hits

Advertisements

Programming Enigma Puzzles

14 April 2014

Posted by on **From New Scientist #2491, 19th March 2005**

George, and his brothers Fred and Henry, are comparing the PIN codes they have been given for their new credit cards. Each is a four digit number, and none contain a zero digit. The last digit of Fred’s number is the same as the first digit of George’s, the last digit of George’s is the first digit of Henry’s, and the last digit of Henry’s is the first digit of Fred’s. Apart from these three pairs of different digits, no digit occurs more than once among the PINs.

The brothers have each calculated the sum of the squares of the four digits in their PIN and to their great surprise they found that the three totals are exactly the same.

What is the sum of the four digits in George’s PIN?

[enigma1332]

Advertisements

%d bloggers like this:

This Python program runs in 35ms.

Solution:The sum of the digits of George’s PIN is 20.The question gives us no way to distinguish George, Fred and Henry, so for any solution (A, B, C) any other permutation will also be a solution. Hence the six solutions my program finds. Fortunately the sums of the digits for all three PINs is the same, so there is only one possible answer to the problem.

Yes, a permutation solution confirms your answer.

It also gives possible solutions for the pin numbers, after duplicate solutions are eliminated.

ie

George = 2945, Fred = 8732, Henry = 5618

George = 2738, Fred = 5942, Henry = 8615

George = 5942, Fred = 8615, Henry = 2738

George = 5618, Fred = 2945, Henry = 8732

George = 8732, Fred = 5618, Henry = 2945

George = 8615, Fred = 2738, Henry = 5942