This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A095986 #34 Mar 09 2024 10:31:41 %S A095986 1,0,0,1,0,1,0,0,1,1,1,0,1,1,2,4,3,2,5,15,21,66,37,51,144,263,601, %T A095986 1333,2119,2154,2189,3280,12405,55329,160895,588081,849906,1258119, %U A095986 1233262,2478647,4305500,17278636,47424179,153686631,396952852,1043844982 %N A095986 A card-arranging problem: number of permutations p_1, ..., p_n of 1, ..., n such that i + p_i is a square for every i. %C A095986 Gardner attributes the problem (for the case n = 13) to David L. Silverman. %D A095986 M. Gardner, Mathematical Games column, Scientific American, Nov 1974. %D A095986 M. Gardner, Mathematical Games column, Scientific American, Mar 1975. %D A095986 M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 81. %F A095986 a(n) = permanent(m), where the n X n matrix m is defined by m(i,j) = 1 or 0, depending on whether i+j is a square or not. %e A095986 a(0) = 1: the empty permutation. %e A095986 a(3) = 1: 321. %e A095986 a(5) = 1: 32154. %e A095986 a(8) = 1: 87654321. %e A095986 a(9) = 1: 826543917. %p A095986 b:= proc(s) option remember; (n-> `if`(n=0, 1, add( %p A095986 `if`(issqr(n+j), b(s minus {j}), 0), j=s)))(nops(s)) %p A095986 end: %p A095986 a:= n-> b({$1..n}): %p A095986 seq(a(n), n=0..25); # _Alois P. Heinz_, Mar 03 2024 %t A095986 nmax=45; a[n_]:=Permanent[Table[If[IntegerQ[Sqrt[i+j]],1,0],{i,n},{j,n}]]; Join[{1},Array[a,nmax]] (* _Stefano Spezia_, Mar 03 2024 *) %Y A095986 Cf. A006063 (for cubes), A010052, A073364. %K A095986 nonn,hard,more %O A095986 0,15 %A A095986 _Franklin T. Adams-Watters_, Jul 18 2004 %E A095986 a(32) and a(33) from _John W. Layman_, Jul 21 2004 %E A095986 a(34)-a(36) from _Ray Chandler_, Jul 26 2004 %E A095986 a(37)-a(45) from _William Rex Marshall_, Apr 18 2006 %E A095986 a(0)=1 prepended by _Alois P. Heinz_, Mar 03 2024