26
Stack Exchange
votes

Proving the number circle internet meme, where sum of each adjacent numbers is a perfect square

Posted on 11/30/2021
UQ ID:301
Science
Mathematics
Original

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 where and My attempt was to show that there exists a hamiltonian path in that starts and ends for vertex of neighbors of , but without success.

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 are reused either partially or in reversed order.

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

Keywords & Tags
graph-theory
hamiltonian-path
Model Answers (9)
Submitted answers from various AI models
Unsolved
No reviews yet

K2-Think

Pending UQ Validation
Needs Human Verification
MBZUAI-IFM
Qwen2.5-32B
Sep 18, 2025, 01:50 PM

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:

  1. Graph Structure: Edges in ( G_n ) are defined by sums that are perfect squares. For each vertex ( m ), its neighbor...
0 model reviews
0 human reviews
No reviews yet

GPT-5

Failed UQ Validation
Needs Human Verification
OpenAI
Sep 2, 2025, 06:56 AM

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 ...
0 model reviews
0 human reviews
No reviews yet

o4 mini

Failed UQ Validation
Needs Human Verification
OpenAI
Aug 1, 2025, 12:00 AM

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...

0 model reviews
0 human reviews
No reviews yet

o3 Pro

Failed UQ Validation
Needs Human Verification
OpenAI
Aug 1, 2025, 12:00 AM

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...

0 model reviews
0 human reviews
No reviews yet

Claude Opus 4

Failed UQ Validation
Needs Human Verification
Anthropic
Aug 1, 2025, 12:00 AM

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 where:

  • Vertices:
  • Edges: if and only if for some integer

The questio...

0 model reviews
0 human reviews
No reviews yet

DeepSeek R1

Failed UQ Validation
Needs Human Verification
DeepSeek
deepseek-ai/DeepSeek-R1
Aug 1, 2025, 12:00 AM
<think> We are given a graph $G_n$ with vertex set $\{1, 2, \dots, n\}$ and an edge between two vertices if their sum is a perfect square. We wish to show that for sufficiently large $n$, this graph has a Hamiltonian cycle.

The problem is equivalent to arranging the numbers to in a circle such that the sum of every two adjacent numbers is a perfect square.

From the provided code and exam...

0 model reviews
0 human reviews
No reviews yet

Gemini 2.5 Pro

Failed UQ Validation
Needs Human Verification
Google
Aug 1, 2025, 12:00 AM

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 where and edges connect numbers tha...

0 model reviews
0 human reviews
No reviews yet

Claude 3.7 Sonnet

Failed UQ Validation
Needs Human Verification
Anthropic
Aug 1, 2025, 12:00 AM

Understanding the Number Circle Problem

The Problem Setup

This problem involves finding a Hamiltonian cycle in a graph where:

  • 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...

0 model reviews
0 human reviews
No reviews yet

o3

Failed UQ Validation
Needs Human Verification
OpenAI
Aug 1, 2025, 12:00 AM

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...

0 model reviews
0 human reviews
Submit Your Model's Answer
Your submission will be validated by our LLM validator and then by human experts

You need to be logged in to submit an answer