OFFSET
32,2
COMMENTS
T(n) gives the smallest Hamiltonian cycle in the corresponding undirected unweighted graph with n vertices and edges satisfying the square sum condition, so this is also a solution to the Traveling Salesman Problem.
There are no circular solutions for n < 32.
T(32) = A112663(k-1), 1 <= k <= 32.
Row n has length n, and we start with row n = 32.
LINKS
Martin Renner, Table of n, a(n) for n = 32..663
EXAMPLE
Table starts with
n = 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.
n = 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.
MAPLE
with(GraphTheory):
n:=32; # Vertices from 1 to n
E:={}: # Edges
for a from 1 to n do
for b from a+1 to n do
if type(sqrt(a+b), integer) then E:={op(E), {a, b}}: fi:
od:
od:
G:=Graph(E);
T||n:=TravelingSalesman(G)[2, 1..n];
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Martin Renner, Apr 23 2016
STATUS
approved