13

I got this interesting arrangement of numbers from $1$ to $32$ in a group in Facebook- enter image description here

This being an interesting property to look at, I was trying to figure out whether $32$ is something special, or does this hold for other numbers as well. So, let's say, we want to construct one such circle for a general $n$. My idea was to take any $m\in \mathbb N_n=\{1,2,\dots ,n\}$ and find two different integers $x,y\in\mathbb N_n$ so that both $(m+x)$ and $(m+y)$ are perfect squares. Then, we need to find $x^\prime, y^\prime\in \mathbb N_n$ different from $x$, $y$ and $m$ such that both $(x+x^\prime)$ and $(y+y^\prime)$ are perfect squares. Then, we can continue in this manner.

Now, for any two $a,b\in \mathbb N_n$, we have $2\leq a+b\leq 2n$. So, for our given $m$, when we are looking for the mentioned $x$ and $y$, we only need to check through all the perfect squares in the interval $[m,2n]$. So, to reduce our work, we can take our initial choice $m$ to be equal to $n$.

But, now comes the main problem. Let's say, we want to work it out for $\mathbb N_{33}$. So, let's say, our initial $m$ is $33$. The values of $x$ and $y$ can be from the set $\{3,16,31\}$. The question is, which two of these three to choose so that eventually we don't run into a repitition. Note that, in the $\mathbb N_{32}$ case (which is the one in the diagram), taking $m=32$ leaves us with an advantage of having only two choices $4$ and $17$. But, in the next step, for finding the appropriate $x^\prime$ for $x=4$, we have the choices $\{5,12,21\}$ (since $32$ is already taken). The given diagram uses $x^\prime =21$. I tried using $x^\prime =5$ and then using values of my choice, but soon ran into an unavoidable repitition.

So, is there a way to make more circles with other values of $n$, or does $32$ have some profound property which makes it the only possible choice for $n$? I thought, maybe $32$ being a power of $2$ has to do something with it. So, I tried using $n=2,4,8,16$. But, these are trivially NOT solutions since there aren't enough perfect squares in $[n,2n]$ for these values of $n$. Note that this "not enough squares" angle immediately gives a lower bound of $n\geq 19$ by trial and error. Peter Taylor pointed out in the MathOverflow post that this "not enough squares" argument also rules out $n\le 30$ since $18$ is always a vertex of degree $1$ otherwise. So, we have a lower bound of $n\ge 31$. Also, I was too lazy to even attempt $n=64$.

So, is this case a rare coincidence, or can we have other values of $n$ satisfying this property as well? If there are other values, what family do they belong to? Also, for any case, is that arrangement unique?

Edit: I got one interesting answer that uses graph theory. But, that has a computer program to check that it holds for all $100\geq n\geq 32$. However, I want more "mathy" arguments. I want to see why this happens instead of to only confirm that it happens. I want to know whether it happens for all $n$ or whether there are cases where it breaks down. Please consider these questions as well.

Also, here's the MathOverflow post of the same question. This answer gives two sequences in the Online Encyclopedia of Integer Sequences, A071983 and A071984 which seems somewhat relevant.

Sayan Dutta
  • 10,345
  • Is your question how this arrangement has been found and whether it is essentially unique ? – Peter Oct 27 '21 at 15:28
  • 3
    One way to solve this is to construct a graph with $N$ vertices where two vertices are adjacent if and only if the number of the vertices sum up to a perfect square. The object is then to find a hamilton cycle in this graph. – Peter Oct 27 '21 at 15:31
  • 4
    This is a nice problem. Similar questions have been asked for a while, some information can be found e.g. in this answer by Tito Piezas III – Viera Čerňanová Oct 27 '21 at 15:33
  • The below answer demonstrates that the number of edges is small enough that the determination of a hamilton cycle is still feasible for a surprising large number of vertices. More interesting however would be a specific method that works for every $N\ge 32$ , is such a method known ? – Peter Oct 27 '21 at 15:38
  • 1
    This comment seems to mostly explain things: https://math.stackexchange.com/questions/1168983/arranging-numbers-from-1-to-n-such-that-the-sum-of-every-two-adjacent-number#comment2382827_1168983 – DanielV Oct 27 '21 at 19:41
  • @Peter my question is basically how we can generalise it. Take what you want from that. – Sayan Dutta Oct 28 '21 at 15:20
  • @user376343 I saw a similar question, but that (and this one as well) deals with numbers arranged in a row, mine deals with a circle. – Sayan Dutta Oct 28 '21 at 15:21
  • @DanielV yes, that's a good comment. How do you share comments by the way? – Sayan Dutta Oct 28 '21 at 15:23
  • @Asher2211 what change did you make in the MathJax code for formatting the picture? – Sayan Dutta Oct 28 '21 at 15:25
  • @SayanDutta I saw the problem in January 5 2021 here As for the linked answer by Tito Piezas III ... I was thinking of the comment below his answer. – Viera Čerňanová Oct 28 '21 at 15:39
  • 1
    This is neat! +1. – Jair Taylor Oct 29 '21 at 19:56
  • @JairTaylor so is your work on group laws and hypergraph colourings! Didn't understand much (being just an undergrad) to be honest, but still, found it quite interesting :) – Sayan Dutta Oct 30 '21 at 09:20
  • @SayanDutta Oh, thank you very much :) – Jair Taylor Oct 31 '21 at 05:14

2 Answers2

8

The idea is to construct a graph $G(n)$ on the vertex set $V = \{1, 2, \ldots, n\}$, where an edge is drawn between vertices $v_i \ne v_j$ if and only if $v_i + v_j = k^2$ for some integer $k$. Then we search for a Hamiltonian cycle in $G$. If such a cycle exists for a given $n$, then the integers from $1$ to $n$ can be arranged without repetition in such a circle as shown in your image.

This is easily done in Mathematica as follows:

G[n_] := AdjacencyGraph[
           Table[Boole@And[IntegerQ[Sqrt[i + j]], i != j], {i, 1, n}, {j, 1, n}]]

t = Select[Table[n, {n, 3, 100}], HamiltonianGraphQ[G[n]]] FindHamiltonianCycle[G[#]]& /@ t

Then $t$ looks like this:

$$t = \{32, 33, 34, \ldots, 100 \}$$

This proves $n = 32$ is the smallest such graph that admits a circle of the desired type, and suggests but does not prove that for every $n > 32$, a circle of the desired type exists.

For instance, $n = 100$ gives the circle

$$\{1,80,89,11,70,30,91,9,72,28,53,47,74,7,93,51,49,32,68,13,87,34,66,15,85,59,41,40,81,19,17,83,61,60,84,37,27,54,46,75,6,94,50,71,10,90,31,69,12,88,33,67,14,86,35,65,16,20,29,52,92,8,73,48,96,4,77,23,98,2,79,21,100,44,56,25,39,42,58,63,18,82,62,38,43,57,64,36,45,55,26,95,5,76,24,97,3,78,22,99\}.$$

heropup
  • 143,828
  • This observation is quite nice! (+1) But we still haven't proved anything. Do you know of any tests to check the existence of Hamiltonian cycles in a graph? I don't think I know any such test :( – Sayan Dutta Oct 28 '21 at 15:18
  • Where did you run that program? Can you maybe add a link please.... – Sayan Dutta Oct 29 '21 at 05:15
  • Are these circles unique for a given $n$? Or can we fix an $n$ and create some type of algebraic structure between all the possible circles? – Sidharth Ghoshal Aug 22 '22 at 22:53
3

Assuming that $S_n$ is the number of distinct sums, of two distinct numbers, pertaining to $\mathbb{N}_n$ which are equal to squares, it follows by induction that $\{S_n\}$ is a monotonically non-decreasing sequence. Indeed,

$$ S_{n} = S_{n-1} + T_n ~~~(n \geq 2)$$

where $S_1 = 0$, and $T_n$ is the number of squares between $n+1$ and $2n-1$ (the range of the sums between the new element $n$ and all numbers in the previous set $\mathbb{N}_{n-1}$). Note that these cyclic sequences of $n$ integers are made of $n$ distinct pairs of numbers which sum up to a square. Therefore, $S_n \geq n$ is a necessary condition for the existence of such cycles.

Running a simple code in Sage:

S = [0]
for n in [2..100]:
   S.append(S[-1] + len([i for i in [n+1..2*n-1] if is_square(i) == True]))

I did find:

$$ \{S_n\} = \{0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 20, 22, 24, \ldots\}$$

which in a quick search had an match with OEIS:A176615, defined by the same problem in terms of graph theory. It seems that $S_n \geq n$ when $n \geq 15$. This is a quite awful lower bound, because the constraint in terms of $S_n$ isn't very tight. Although this isn't a answer to the general question, I've thought it would be a good idea to expose this result here, at least as a first attempt to make some sense of the confirmed lower bound at $n = 32$.

Sayan Dutta
  • 10,345
  • I see... Thanks for the answer (+1) But, this lower bound doesn't really add anything. I already got a lower bound of $n\geq 19$ as I mentioned in the question. – Sayan Dutta Nov 10 '21 at 06:40
  • Oh... I'm sorry, my bad, I didn't read properly your post. I'll seek for a more useful result, in order to improve the remark. – matheusbm98 Nov 10 '21 at 14:17