Proving the number circle internet meme, where sum of each adjacent numbers is a perfect square
Proving the number circle internet meme, where sum of each adjacent numbers is a perfect square
I came across this internet meme and one of my friend mentioned that he thinks that such number circle would always exists for any big enough integer. We tried to prove the hypothesis, but could not find a proof.
We defined the circle to be a Hamiltonian cycle of a graph
PS: I built a simple program that brute forcely computes for a hamiltonian cycle of such graph and got this for result
31 : false 32 : 1-8-28-21-4-32-17-19-30-6-3-13-12-24-25-11-5-31-18-7-29-20-16-9-27-22-14-2-23-26-10-15 33 : 1-8-28-21-4-32-17-19-30-6-3-13-12-24-25-11-5-20-29-7-18-31-33-16-9-27-22-14-2-23-26-10-15 34 : 1-3-13-12-4-32-17-8-28-21-15-34-30-19-6-10-26-23-2-14-22-27-9-16-33-31-18-7-29-20-5-11-25-24 35 : 1-3-6-19-30-34-2-7-18-31-33-16-9-27-22-14-11-25-24-12-13-23-26-10-15-21-28-8-17-32-4-5-20-29-35 36 : 1-3-6-19-30-34-2-23-26-10-15-21-4-32-17-8-28-36-13-12-24-25-11-5-20-29-7-18-31-33-16-9-27-22-14-35 37 : 1-3-22-14-35-29-20-5-11-25-24-12-37-27-9-16-33-31-18-7-2-34-15-21-4-32-17-19-30-6-10-26-23-13-36-28-8 ... 58 : 1-3-6-10-15-21-4-5-11-25-39-42-58-23-13-36-28-53-47-2-34-30-51-49-32-17-19-45-55-26-38-43-57-24-40-41-8-56-44-37-12-52-48-33-31-50-14-22-27-54-46-18-7-9-16-20-29-35
I don't know if this is any clue, but nearly every path segments between each
PS2: If anyone is interested in generating their own series, to reduce the burden, here is a javascript source code of generating brute force Hamiltonian cycle of the graph. var size = 32; var maxSqrt = () => Math.sqrt(size * 2 - 1) | 0;
function isSquare(x) { return x > 0 && Math.sqrt(x) % 1 === 0; }
function foo(n = 1, step = 0, visited = new Array(size).fill(false)) { if (step == size - 1) { if (isSquare(n + 1)) { return n; } else { return false; } }
visited[n - 1] = true;
//find edges var minSqrt = Math.ceil(Math.sqrt(n)); minSqrt = minSqrt === 1 ? 2 : minSqrt;
//recursivly run edges for (var i = minSqrt; i <= maxSqrt(); i++) { var target = i * i - n; if (n != target && !visited[target - 1] && target <= size && target > 0) { var temp = foo(target, step + 1, visited.slice(0)); if (!temp) continue; else { return n + "-" + temp; } } } return false; }
console.log(size + " : " + foo());
PS3: The question about Hamiltonian path of n numbers seems relevant to this question
K2-Think
The problem concerns proving the existence of a Hamiltonian cycle in the graph ( G_n ), where vertices are ( {1, 2, \ldots, n} ) and edges connect pairs ( (v_1, v_2) ) if ( v_1 + v_2 ) is a perfect square.
Key observations from the user's examples and analysis:
- Graph Structure: Edges in ( G_n ) are defined by sums that are perfect squares. For each vertex ( m ), its neighbor...
GPT-5
What you are looking at is the “square-sum circle” (or “squareful permutation on a circle”) problem. In your notation, it asks for a Hamiltonian cycle in the graph G_n on {1,…,n} with an edge uv whenever u+v is a perfect square.
What is known
- It is known (and easy to check by computer) that there is no Hamiltonian cycle for n ≤ 31. In particular, n = 31 has no square-sum circle. Your program’s ...
o4 mini
What you have stumbled on is one of the little “folklore’’ problems in Hamiltonian‐graph theory whose answer is, as of today, still unknown. In the literature it is usually called the “square‐sum” or “squareful‐permutation’’ problem:
• Define Gₙ on the vertex‐set {1,2,…,n} by joining i to j precisely when i+j is a perfect square.
• We ask for a Hamiltonian cycle in Gₙ, i.e. a circular ar...
o3 Pro
What you have rediscovered is a classical unsolved problem that goes under several different names:
• the Square–sum (or Square-pair) graph
• squareful permutations
• the Square-sum Hamilton cycle problem.
For every n≥1 let
Gₙ = ( V = {1,…,n}, E = { {a,b} ⊆ V : a+b is a perfect square} ).
The question is:
Does Gₙ contain a Hamiltonian cycle (or at least a Hamiltonian path) for every su...
Claude Opus 4
This is a fascinating problem about finding Hamiltonian cycles in graphs where edges connect vertices whose sum is a perfect square. Let me analyze what we know and discuss the current state of this problem.
Problem Definition
You're looking at graphs
- Vertices:
- Edges:
if and only if for some integer
The questio...
DeepSeek R1
The problem is equivalent to arranging the numbers
From the provided code and exam...
Gemini 2.5 Pro
This is an excellent question about a well-known and surprisingly difficult problem in recreational mathematics and graph theory. It's sometimes called the "Sum of Squares" circle or attributed to a puzzle popularized by Matt Parker.
Your formalization of the problem is perfect. You are looking for a Hamiltonian cycle in the graph
Claude 3.7 Sonnet
Understanding the Number Circle Problem
The Problem Setup
This problem involves finding a Hamiltonian cycle in a graph
- Vertices are integers from 1 to n:
- Two vertices are connected by an edge if their sum is a perfect square:
The brute force results suggest that...
o3
The graph you defined
Gₙ = (V,E) , V = { 1,…,n }, E = { {u,v} ⊂ V : u+v is a perfect square }
is usually called the square-sum graph or the square graph on the first n positive integers.
Putting the vertices on a circle in such an order that every two neighbours add up to a square is exactly the same as asking whether Gₙ possesses a Hamiltonian cycle (sometimes one only asks for a Hamilt...
You need to be logged in to submit an answer