cp's OEIS Frontend

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.

A293857 a(n) is the number of permutations {c_1..c_n} of {1..n} for which c_1 - c_2 + ... + (-1)^(n-1)*c_n are squares.

This page as a plain text file.
%I A293857 #32 Sep 17 2020 20:22:10
%S A293857 1,1,1,4,12,36,144,1440,9216,66240,504000,7344000,73612800,830995200,
%T A293857 9373190400,181875456000,2474319052800,38246274662400,572552876851200,
%U A293857 13783143886848000,237527801118720000,4658378696294400000,86818505051013120000,2488457229932298240000
%N A293857 a(n) is the number of permutations {c_1..c_n} of {1..n} for which c_1 - c_2 + ... + (-1)^(n-1)*c_n are squares.
%C A293857 For a permutation C = {c_1..c_n} of {1..n}, set s(C) = c_1 - c_2 + ... + (-1)^(n-1)*c_n. Then max s(C) is square that is (ceil(n/2))^2 or A008794(n+1).
%C A293857 a(n)/n! is slowly and non-monotonically decreasing: 1, 1/2, 2/3, 1/2, 3/10, 1/5, 2/7, 8/35, 23/126, 5/36, 85/462, 71/462, ... .
%C A293857 Positions for which a(n) divisible by all primes <= n: 1, 4, 10, ... .
%C A293857 The smallest primes <= n not dividing a(n) or 0 if there is no such primes: 0, 2, 3, 0, 5, 5, 7, 5, 7, 0, 7, 7, ... .
%C A293857 Let k = floor(n / 2). Then a(n) = divisible by k! * (n-k)!. - _David A. Corneth_, Oct 18 2017. (For a proof, cf. comment in A293984. - _Vladimir Shevelev_, Nov 06 2017)
%H A293857 Peter J. C. Moses, <a href="/A293857/b293857.txt">Table of n, a(n) for n = 0..200</a>
%F A293857 From author's comment in A008794 it follows that a(n) >= A010551(n).
%e A293857 Let n=3. For a permutation C={c_1,c_2,c_3}, set s = s(C) = c_1 - c_2 + c_3. We have the permutations:
%e A293857 1,2,3; s=2
%e A293857 1,3,2; s=0
%e A293857 2,1,3; s=4
%e A293857 2,3,1; s=0
%e A293857 3,1,2; s=4
%e A293857 3,2,1; s=2
%e A293857 Here there are 4 permutations for which {s} are squares. So a(3)=4.
%p A293857 b:= proc(p, m, s) option remember; (n-> `if`(n=0, `if`(issqr(s), 1, 0),
%p A293857       `if`(p>0, b(p-1, m, s+n), 0)+`if`(m>0, b(p, m-1, s-n), 0)))(p+m)
%p A293857     end:
%p A293857 a:= n-> (t-> b(n-t, t, 0)*t!*(n-t)!)(iquo(n, 2)):
%p A293857 seq(a(n), n=0..28);  # _Alois P. Heinz_, Sep 17 2020
%t A293857 a293857=Table[Total[(Floor[n/2]!*(n-Floor[n/2])!)(Reverse[Map[SeriesCoefficient[QBinomial[n,Floor[(n+1)/2],q],{q,0,#}]&,Map[2#(Floor[(n+1)/2] - #)&,Range[0,Floor[(n+1)/4]]]]]
%t A293857 )],{n,25}] (* _Peter J. C. Moses_, Nov 01 2017 *)
%Y A293857 Cf. A000290, A008794, A293783, A293984.
%K A293857 nonn
%O A293857 0,4
%A A293857 _Vladimir Shevelev_, Oct 17 2017
%E A293857 a(5)-a(12) from _Peter J. C. Moses_, Oct 17 2017
%E A293857 a(13)-a(23) from _David A. Corneth_, Oct 17 2017
%E A293857 a(0)=1 prepended by _Alois P. Heinz_, Sep 17 2020