Search: id:A090460 Results 1-1 of 1 results found. %I A090460 %S A090460 1,1,1,0,0,0,0,0,3,0,10,12,35,52,19,20,349,361,637,3678,15237,11875, %T A090460 13306,10964,27223,37054,201408,510152 %N A090460 Number of essentially different permutations of the numbers 1 to n such that the sum of adjacent numbers is a square. %C A090460 For n > 31, some solutions are circular; that is, the first and last numbers also sum to a square. Note that A071983 counts each circular solution n times. This sequence counts each circular solution only once. The Mathematica program uses backtracking to find all solutions, which can be printed by removing the comment symbols. %F A090460 a(n) = A071983(n) - (n-1)*A071984(n) %e A090460 See A071983 %t A090460 SquareQ[n_] := IntegerQ[Sqrt[n]]; try[lev_] := Module[{t, j, circular}, If[lev>n, circular=SquareQ[soln[[1]]+soln[[n]]]; If[(!circular&&soln[[1]]