TOPICS
Search

Square-Sum Problem


The square-sum problem asks for a permutation of the integers from 1 through n, where n>=2 is an integer, such that the sum of each pair of adjacent entries is a square number. Such an arrangement is called a square chain. The circular variant also requires the last and first entries to have a square number as their sum and is called a square necklace, with n>=3.

The problem has a graph-theoretic formulation. Take the vertex set to be {1,...,n} and join two distinct vertices by an edge exactly when their sum is a square number. Square chains are then Hamiltonian paths in this graph, and square necklaces are Hamiltonian cycles.

The possible sizes of square chains are 15, 16, 17, 23, 25, 26, ..., comprising the four exceptional values 15, 16, 17, and 23 together with every n>=25 (OEIS A090461). Gerbicz proved the existence of square chains for every n>=25 and square necklaces for every n>=32 (Berlekamp and Guy 2020, p. 346). No square necklace exists for 3<=n<32.

For example, a square chain for n=15 is

 8,1,15,10,6,3,13,12,4,5,11,14,2,7,9.

Identifying a chain with its reversal, the numbers of square chains for n=15, 16, ... begin 1, 1, 1, 0, 0, 0, 0, 0, 3, 0, 10, ... (OEIS A071983). Circular arrangements are counted with both rotations and reversals identified. Under this convention there is exactly one square necklace for n=32 (OEIS A071984). A square necklace on n distinct entries yields n different linear chains by cutting at its different adjacent pairs, even after identifying linear reversals.


See also

Hamiltonian Cycle, Hamiltonian Path, Permutation, Square Number

Explore with Wolfram|Alpha

References

Berlekamp, E. R. and Guy, R. K. "Fibonacci Plays Billiards." Crux Math. 46, 334-347, 2020. https://cms.math.ca/wp-content/uploads/2020/09/CRUXv46n8.pdf.Numberphile. "The Square-Sum Problem." Featuring M. Parker. Jan. 11, 2018. https://www.youtube.com/watch?v=G1m7goLCJDY.Sloane, N. J. A. Sequences A071983, A071984, and A090461in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Square-Sum Problem." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Square-SumProblem.html

Subject classifications