OFFSET
0,5
COMMENTS
Equivalently, number of partitions of the set of the first n triangular numbers {t(1),...,t(n)} into two classes with equal sums.
Constant term in the expansion of (x + 1/x)(x^3 + 1/x^3)...(x^t(n) + 1/x^t(n)).
a(n) = 0 for all n == 1 (mod 4).
Andrica & Tomescu give a more general integral formula than the one below. - Jonathan Sondow, Nov 11 2013
LINKS
Ray Chandler, Table of n, a(n) for n = 0..633
Dorin Andrica and Ioan Tomescu, On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance, J. Integer Sequences, 5 (2002), Article 02.2.4.
FORMULA
a(n) = (2^n/Pi) * Integral_{x=0..Pi} cos(x)*cos(3x)*...*cos(n(n+1)x/2) dx.
a(n) ~ 2^(n+1)*sqrt(10/Pi)*n^(-5/2)*(1+o(1)) as n --> infinity, n !== 1 (mod 4).
a(n) = 2 * A058498(n) for n > 0. - Alois P. Heinz, Nov 01 2011
EXAMPLE
For n=6 the 2 solutions are +1-3+6-10-15+21 = 0 and -1+3-6+10+15-21 = 0.
MAPLE
N:=70: p:=1: a:=[]: for n from 0 to N do
p:=expand(p*(x^(n*(n+1)/2)+x^(-n*(n+1)/2))):
a:=[op(a), coeff(p, x, 0)]: od:a;
# second Maple program:
b:= proc(n, i) option remember; (m-> `if`(n>m, 0,
`if`(n=m, 1, b(abs(n-i*(i+1)/2), i-1)+
b(n+i*(i+1)/2, i-1))))((2+(3+i)*i)*i/6)
end:
a:= n-> `if`(irem(n, 4)=1, 0, b(0, n)):
seq(a(n), n=0..50); # Alois P. Heinz, Sep 17 2017
MATHEMATICA
a[n_] := With[{t = Table[k(k+1)/2, {k, 1, n}]}, Coefficient[Times @@ (x^t + 1/x^t), x, 0]];
Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 50}] (* Jean-François Alcover, Jun 16 2018 *)
PROG
(PARI) t(k) = k*(k+1)/2;
a(n) = polcoeff(prod(k=1, n, (x^t(k)+ 1/x^t(k))), 0); \\ Michel Marcus, May 19 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Pietro Majer, Mar 17 2009
EXTENSIONS
a(0) = 1 prepended by Joerg Arndt, Sep 17 2017
Example corrected by Ilya Gutkovskiy, Feb 02 2022
STATUS
approved