Name or OEIS Entry for a certain set of numbers? I'm considering the set of positive integers $n$ such that the integers from $1$ to $n$ can be arranged in a line such that every two consecutive numbers add to a perfect square. The smallest nontrivial such $n$ is $15$, with the ordering $8, 1, 15, 10, 6, 3, 13, 12, 4, 5, 11, 14, 2, 7, 9$.
$35$ also works, it turns out. Is there a name for these numbers? I tried searching on OEIS, but having only two terms is problematic...
 A: The problem of finding such a rearrangement of $1,\ldots, n$ can be restated in graph theory terms.
For any integer $n > 0$, consider a graph with $n$ vertices. Label the vertices
from $1$ to $n$. For any two vertex $i$ and $j$, we join them by an edge
when and only when $i + j$ is a prefect square. The problem of finding
a desired rearrangement is equivalent to finding a Hamiltonian path in such a graph.
For example, following code in maixma
load(graphs);
H[i,j] := if(integerp(sqrt(i+j))) then 1 else 0;
G(n)   := from_adjacency_matrix(genmatrix(H,n,n));
hamilton_path(G(15))+1;

will return 
$$[9,7,2,14,11,5,4,12,13,3,6,10,15,1,8]$$
which is essentially the rearrangement you have in reverse order.
Using codes above, I have checked for $n \le 100$, the set of $n$ that allow such
an arrangement are $15,16,17,23^{\color{blue}{[1]}}$ and all $n \ge 25$ (except for $n = 86$ where above code hangs).
As pointed out by Michael, a search on this numbers return 
OEIS A090461 and $86$ is also allowed.
Notes


*

*$\color{blue}{[1]}$ Thanks for Michael pointing out my error on $23$.

A: See sequence A071983:

Square chains: the number of permutations (reversals not counted as different) of the numbers 1 to n such that the sum of any two consecutive numbers is a square.

