OFFSET
0,5
LINKS
Ray Chandler, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = [x^n] Product_{k=1..n} (x^k + 1/x^k). - Ilya Gutkovskiy, Jan 28 2022
EXAMPLE
a(8) = 12 because 8 = 1+2+3+4+5-6+7-8 = -1+2+3+4-5+6+7-8 = 1-2+3-4+5+6+7-8 = -1-2-3+4+5+6+7-8 = -1+2+3+4+5-6-7+8 = 1-2+3+4-5+6-7+8 = 1+2-3-4+5+6-7+8 = -1-2+3-4+5+6-7+8 = 1+2-3+4-5-6+7+8 = -1-2+3+4-5-6+7+8 = -1+2-3-4+5-6+7+8 = 1-2-3-4-5+6+7+8.
MATHEMATICA
f[n_, s_] := f[n, s]=Which[n==0, If[s==0, 1, 0], Abs[s]>(n*(n+1))/2, 0, True, f[n-1, s-n]+f[n-1, s+n]]; a[n_] := f[n, n]
nmax = 44; d = {1}; a1 = {1};
Do[
d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n];
i = Ceiling[Length[d]/2] + n;
AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
, {n, nmax}];
a1 (* Ray Chandler, Mar 25 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Aug 28 2001
EXTENSIONS
More terms from Dean Hickerson, Aug 30, 2001
STATUS
approved