This site is supported by donations to The OEIS Foundation.

 Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS". Other ways to donate

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A108658 Number of the essentially different permutations of the numbers 0 to n such that the sum of adjacent numbers is a square. 2
 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4, 4, 0, 0, 4, 5, 2, 8, 7, 47, 72, 135, 283, 158, 164, 1948, 1467, 2998, 20561, 66700, 130236, 153058, 181635, 239386, 343189, 1600832 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,16 COMMENTS A108658 Square chains (reversals not counted and circles counted once). There is no solution for n=2-13,18-19 (note offset=0). For n=0 and n=1 we have trivial square circles (which are also known as square loops). Square circles seem to appear for all n>30, see A108661. Cf. A090460 for 1-to-n case. LINKS EXAMPLE n=14: one solution {8,1,0,9,7,2,14,11,5,4,12,13,3,6,10}; n=15: three solutions {0,9,7,2,14,11,5,4,12,13,3,6,10,15,1,8}, {5,11,14,2,7,9,0,4,12,13,3,6,10,15,1,8}, {8,1,0,9,7,2,14,11,5,4,12,13,3,6,10,15}; n=16: four solutions {0,16,9,7,2,14,11,5,4,12,13,3,6,10,15,1,8}, {5,11,14,2,7,9,16,0,4,12,13,3,6,10,15,1,8}, {8,1,0,16,9,7,2,14,11,5,4,12,13,3,6,10,15}, {8,1,15,10,6,3,13,12,4,5,11,14,2,7,9,0,16}; etc. MATHEMATICA SquareQ[n_]:=IntegerQ[Sqrt[n]]; try[lev_]:=Module[{t, j, circular}, If[lev>n+1, circular=SquareQ[soln[[1]]+soln[[n+1]]]; If[(!circular&&soln[[1]]

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.