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 A294811 #33 Sep 17 2020 23:05:09 %S A294811 1,1,1,1,2,4,6,11,16,30,48,97,157,322,524,1077,1777,3684,6157,12876, %T A294811 21684,45520,77212,162533,277608,585993,1006784,2129433,3677453, %U A294811 7788711,13514487,28654668,49933938,105964856,185377690,393631445,691101516,1468137470 %N A294811 Let b(n) be the number of permutations {c_1..c_n} of {1..n} for which c_1 - c_2 + ... + (-1)^(n-1)*c_n are triangular numbers (A000217). Then a(n) = b(n)/A010551(n). %C A294811 All terms are positive integers (for a proof, cf. comment in A293984). Note that a(1), a(2), a(3), a(4) remain the same if in the definition the triangular numbers are replaced by k-gonal numbers for k >= 5. %H A294811 Alois P. Heinz, <a href="/A294811/b294811.txt">Table of n, a(n) for n = 0..250</a> (terms n=1..200 from Peter J. C. Moses) %e A294811 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 A294811 1,2,3; s=2 %e A294811 1,3,2; s=0 %e A294811 2,1,3; s=4 %e A294811 2,3,1; s=0 %e A294811 3,1,2; s=4 %e A294811 3,2,1; s=2 %e A294811 Here there are 2 permutations for which {s} are triangular numbers (when s = 0). Further, since A010551(3) = 2, then a(3) = 1. %e A294811 Let n=4. For a permutation C={c_1,c_2,c_3,c_4}, set s = s(C) = c_1 - c_2 + c_3 - c_4. We have the permutations: %e A294811 1,2,3,4; s=-2 %e A294811 1,3,2,4; s=-4 %e A294811 2,1,3,4; s=0 %e A294811 2,3,1,4; s=-4 %e A294811 3,1,2,4; s=0 %e A294811 3,2,1,4; s=-2 %e A294811 1,2,4,3; s=0 %e A294811 1,3,4,2; s=0 %e A294811 2,1,4,3; s=2 %e A294811 2,3,4,1; s=2 %e A294811 3,1,4,2; s=4 %e A294811 3,2,4,1; s=4 %e A294811 1,4,2,3; s=-4 %e A294811 1,4,3,2; s=-2 %e A294811 2,4,1,3; s=-4 %e A294811 2,4,3,1; s=0 %e A294811 3,4,1,2; s=-2 %e A294811 3,4,2,1; s=0 %e A294811 4,1,2,3; s=2 %e A294811 4,1,3,2; s=4 %e A294811 4,2,1,3; s=0 %e A294811 4,2,3,1; s=4 %e A294811 4,3,1,2; s=0 %e A294811 4,3,2,1; s=2 %e A294811 Here there are 8 permutations for which {s} are triangular numbers (when s = 0). Further, since A010551(4) = 4, then a(4) = 8/4 = 2. %p A294811 b:= proc(p, m, s) option remember; (n-> `if`(n=0, `if`(issqr(8*s+1), 1, 0), %p A294811 `if`(p>0, b(p-1, m, s+n), 0)+`if`(m>0, b(p, m-1, s-n), 0)))(p+m) %p A294811 end: %p A294811 a:= n-> (t-> b(n-t, t, 0))(iquo(n, 2)): %p A294811 seq(a(n), n=0..40); # _Alois P. Heinz_, Sep 17 2020 %t A294811 polyQ[order_,n_]:=If[n==0,True,IntegerQ[(#-4+Sqrt[(#-4)^2+8 n (#-2)])/(2 (#-2))]&[order]];(*is a number polygonal?*) %t A294811 Map[Total,Table[ %t A294811 possibleSums=Range[1/2-(-1)^n/2-Floor[n/2]^2,Floor[(n+1)/2]^2]; %t A294811 filteredSums=Select[possibleSums,polyQ[3,#]&&#>-1&]; %t A294811 positions=Map[Flatten[{#,Position[possibleSums,#,1]-1}]&,filteredSums]; %t A294811 Map[SeriesCoefficient[QBinomial[n,Floor[(n+1)/2],q],{q,0,#[[2]]/2}]&,positions],{n,25}]] (* _Peter J. C. Moses_, Jan 02 2018 *) %Y A294811 Cf. A010551, A293857, A293984. %K A294811 nonn %O A294811 0,5 %A A294811 _Vladimir Shevelev_ and _Peter J. C. Moses_, Nov 09 2017 %E A294811 a(0)=1 prepended by _Alois P. Heinz_, Sep 17 2020