Projects · Number puzzle

Ambigram Magic Square

Sixteen numbers in clock-radio digits. Turn the square upside down or hold it to a mirror: the digits change, the numbers change, and every row, column and diagonal still adds up to 176.

Square I Square II · neon

Square I · try it

Turn it, mirror it

What the eye reads: upright
NumbersRow sum
11225885176
55881221176
82512518176
28158152176
176176176176column sums

Diagonals: 176 and 176

Every row, column and both diagonals add up to 176.

Turning the square 180° reverses every number and the order of the cells (12 becomes 21). A mirror also swaps the digits 2 and 5, which are mirror images of each other in seven segments (12 becomes 51). Turning and mirroring together is the same as flipping the square top to bottom.

Square II · neon

Turn it upside down

Sixteen numbers made of 2, 5, 6 and 9. Upright every row, column and diagonal adds up to 242. Turned 180°, 6 and 9 trade places: the rows and columns still add up to 242, the diagonals give 176 and 296.

What the eye reads: upright
NumbersRow sum
22596596242
69922655242
56259962242
95665229242
242242242242column sums

Diagonals: 242 and 242

Every row, column and both diagonals add up to 242.

Why no mirror here: in seven segments a mirrored 6 or 9 is not a digit at all, so the neon square can only be turned. Upright it is even pandiagonal: the broken diagonals and every 2×2 block also add up to 242.

Four digits

How the digits change

Square I uses only 1, 2, 5 and 8: the seven-segment digits that are still digits after a half turn or a mirror. 1 and 8 survive everything, 2 and 5 trade places in a mirror. Square II adds 6 and 9, which trade places in a half turn but are no digits in a mirror.

DigitUprightTurned 180°MirroredFlipped
1reads 1reads 1reads 1reads 1
2reads 2reads 2reads 5reads 5
5reads 5reads 5reads 2reads 2
8reads 8reads 8reads 8reads 8
6reads 6reads 9no digitno digit
9reads 9reads 6no digitno digit
The maths

Why 176 survives every turn (Square I)

The sixteen numbers are every two-digit combination of 1, 2, 5 and 8. The tens digits form a Latin square, and so do the units: every row and column holds 1, 2, 5 and 8 once in each place. So every line adds up to 10 × 16 + 16 = 176.

Both layers are diagonal too, so the main diagonals also hold all four digits. The layers are orthogonal, each pair of digits appears exactly once, which makes the square a Graeco-Latin square of the kind Euler studied.

Turning, mirroring, swapping 2 with 5 or writing every number backwards only moves the same four digits around inside each line. The constant is built into the construction, not luck: the average digit is 4, the average number 44, and 4 × 44 = 176.

Checked

More lines that add up to 176

What it is not: not pandiagonal (the broken diagonals give 80, 272, 72 and 280, and no arrangement of these sixteen numbers can be), not associative (11 + 52 = 63 but 88 + 25 = 113) and not bimagic. The square started as the key matrix of Shapeshifter, a pen-and-paper cipher where the angle you hold the paper at changes the key.

All projects