### 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

23 March 2013

Posted by on **From New Scientist #2609, 23rd June 2007**

For my brother-in-law’s birthday in 2007 I made up a 4-by-4 magic square for him. Each of the rows, columns and main diagonals added up to his new age. I told him this but then only gave him the incomplete version shown below.

He managed to complete the square but only then realized that the top row of the square represented his date of birth, in the form:

What is his date of birth?

[enigma1448]

Advertisements

%d bloggers like this:

I turned the puzzle in a set of simultaneous equations, and then used the SymPy library to solve it using Python. It runs in 310ms.

Solution:The date of birth is 1 / 3 / 1942 (i.e. 1st March 1942, his age is 65).And here it is without using SymPy. This code runs in 41ms.