Determine all positive integers for which there exists a such that you can put the numbers in a sequence in such a way that the sum of every pair of neighbouring numbers is a square.
, 2022
Solution
For , we take and the sequence
8, 1, 15, 10, 6, 3, 13, 12, 4, 5, 11, 14, 2, 7, 9.
Two neighbouring numbers in this sequence always add up to 9, 16, or 25. For square , we also take and the same sequence as above, except that we multiply all numbers by . Two neighbouring numbers in this sequence always add up to , , or , which are all squares.
Now consider a non-square . We will show that this will not satisfy the conditions. Suppose that there does exists a and a sequence , such that . Write , where is a positive integer such that is not divisible by a square greater than 1. Then for all with , we have that is a square and , hence , which yields that . From this, we obtain that and hence . Therefore, there are at most two distinct residue classes modulo occurring among the , namely the classes of and . However, and , and therefore we must have . Because is not a square, is impossible, hence . But then we have , so there is at most one residue class modulo 2 occurring in the sequence, which gives a contradiction.
We conclude that the that satisfy the conditions are the squares.