%I #20 Dec 29 2018 07:07:08
%S 6,3,3,72,226,358,309,391,547,813,3562,10741,36633,94547,120424,
%T 393670,676579,1088429,5531195,3294327,8335128,27820643,75288569,
%U 111875702,264015370,465407197,687532936,1109951444,3256360099
%N Square loops: the number of circular permutations (reversals not counted as different) of the numbers 0 to n such that the sum of any two consecutive numbers is a square.
%e There is no solution for n=0,...,30, (note offset=31). For n=0,1 we have the trivial square circles {0} and {0,1}, which are not included in the sequence.
%e There are only six possible square loops of the minimum length (n=31 case):
%e {1,0,4,5,31,18,7,29,20,16,9,27,22,3,13,12,24,25,11,14,2,23,26,10,6,30,19,17,8,28,21,15},
%e {1,0,4,12,13,3,6,30,19,17,8,28,21,15,10,26,23,2,14,22,27,9,16,20,29,7,18,31,5,11,25,24},
%e {1,0,4,21,28,8,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},
%e {1,15,10,26,23,2,14,22,27,9,16,20,29,7,18,31,5,11,25,0,4,21,28,8,17,19,30,6,3,13,12,24},
%e {1,15,21,28,8,17,19,30,6,10,26,23,2,14,11,5,31,18,7,29,20,16,9,27,22,3,13,12,4,0,25,24},
%e {1,15,21,28,8,17,19,30,6,10,26,23,2,14,11,25,0,4,5,31,18,7,29,20,16,9,27,22,3,13,12,24}.
%e In the n=32,33 (resp.) cases, there are three square loop solutions:
%e {1,0,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,21,28,8},
%e {1,8,28,21,4,32,17,19,30,6,3,13,12,24,25,11,5,31,18,7,29,20,16,0,9,27,22,14,2,23,26,10,15},
%e {1,8,28,21,15,10,26,23,2,14,22,27,9,16,20,29,7,18,31,5,11,25,0,4,32,17,19,30,6,3,13,12,24},
%e and
%e {1,0,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,21,28,8},
%e {1,8,28,21,4,32,17,19,30,6,3,13,12,24,25,11,5,20,29,7,18,31,33,16,0,9,27,22,14,2,23,26,10,15},
%e {1,8,28,21,15,10,26,23,2,14,22,27,9,16,33,31,18,7,29,20,5,11,25,0,4,32,17,19,30,6,3,13,12,24}
%e (resp.).
%Y Cf. A108658 = square chains.
%Y Cf. A071984, A090460, A108658, A108659, A108660.
%K hard,nice,nonn,more
%O 31,1
%A _Zak Seidov_, _T. D. Noe_ & _Max Alekseyev_ Jun 16 2005
%E a(42)-a(47) from _Donovan Johnson_, Sep 14 2010
%E a(48)-a(52) from _Fausto A. C. Cariboni_, Sep 21 2018
%E a(53)-a(59) from _Bert Dobbelaere_, Dec 29 2018