**From New Scientist #1250, 23rd April 1981** [link]

Many interesting number patterns can be made with popular 15-puzzle in which the numbers from 1 to 15 can slide around in a four-by-four framework.

For example, it is possible to make the top left-hand three-by-three block into many different Magic Squares (i.e. each row of three, each column of three and each diagonal of three adds to the same sum). One such arrangement is shown.

It is also possible to do this in such a way that, again with the space in the bottom right-hand corner, the three numbers in the bottom row of the frame add up to the same total as the three numbers in the right-hand column of the frame, which also add up to the same total as the four numbers in the diagonal of the frame from the bottom left to the top right-hand corner. (And, incidentally, this total is more than each of the row sums of the Magic Square).

Give, in increasing order, the four numbers which must form that diagonal of this special arrangement.

[enigma106]

### Like this:

Like Loading...

This Python solution uses the properties of the 15-puzzle (explored in

Enigma 1444), and the properties of the 3×3 magic square (explored inEnigma 1680). It runs in 41ms.Solution:The numbers in the diagonal are 1, 8, 9 and 15.The program produces the 8-different arrangements of the puzzle that give a solution to the puzzle.

You can verify that the solutions given can actually be made with a standard 15-puzzle by using the Python sliding puzzle solver I wrote for

Enigma 1444(see [ http://jimpulse.blogspot.co.uk/2013/04/sliding-puzzle-in-python.html ]), using commands like this:The top left magic square reads

The other corners (u and x) have 8 and 15 or vice versa.

The row or column containing 8 is completed with 12 and 13 in either order;

the row or column containing 15 is completed with 14 and 4 in either order,

but if one pair is swapped then the other must be too, to preserve parity.

I had to try that out with real sliders, not having understood how to do it by program.

Reflexions in the leading diagonal are also possible, of course.

That gives us the eight possible arrangements (eight further being unattainable).