Back in
An Arrangement of 15 you were asked to place the numbers 1 to 15 in a line so that any two adjacent numbers summed to a square number.
Now, try to arrange the numbers from 1 to 32 in a circle, so any two adjacent numbers again sum a square number.
If we imagine a 32 points graph, such that there is an arc joining A and B if and only if A+B is a square, the problem is equivalent to finding a cycle in such a graph.
1 --> 3, 8, 15, 24
2 --> 7, 14, 23
3 --> 1, 6, 13, 22
4 --> 5, 12, 21, 32
5 --> 4, 11, 20, 31
6 --> 3, 10, 19, 30
7 --> 2, 9, 18, 29
8 --> 1, 17, 28
9 --> 7, 16, 27
10 -> 6, 15, 26
11 -> 5, 14, 25
12 -> 4, 13, 24
13 -> 3, 12, 23
14 -> 2, 11, 22
15 -> 1, 10, 21
16 -> 9, 20
17 -> 8, 19, 32
18 -> 7, 31
19 -> 6, 17, 30
20 -> 5, 16, 29
21 -> 4, 15, 28
22 -> 3, 14, 27
23 -> 2, 13, 26
24 -> 1, 12, 25
25 -> 11, 24
26 -> 10, 23
27 -> 9, 22
28 -> 8, 21
29 -> 7, 20
30 -> 6, 19
31 -> 5, 18
32 -> 4, 17
There's no simple algorithm for finding such a cycle, but we can simplify the graph by noting, for example, that from 28 we can only get to 8 and 21 -- we erase point 28, and remember that the graph will have 8-28-21. Doing this systematically arrives to the solution.