%I #32 Feb 03 2024 10:15:24
%S 0,0,0,1,0,1,1,2,0,6,8,13,0,33,52,105,0,310,485,874,0,2974,5240,9488,
%T 0,30418,55715,104730,0,352467,642418,1193879,0,4165910,7762907,
%U 14493951,0,50621491,95133799,179484713,0,637516130,1202062094,2273709847,0,8173584069
%N Number of solutions to c(1)t(1) + ... + c(n)t(n) = 0, where c(i) = +-1 for i>1, c(1) = t(1) = 1, t(i) = triangular numbers (A000217).
%H Alois P. Heinz and Ray Chandler, <a href="/A058498/b058498.txt">Table of n, a(n) for n = 1..633</a> (first 280 terms from Alois P. Heinz)
%F a(n) = [x^(n*(n+1)/2)] Product_{k=1..n-1} (x^(k*(k+1)/2) + 1/x^(k*(k+1)/2)). - _Ilya Gutkovskiy_, Feb 01 2024
%e a(8) = 2 because there are two solutions: 1 - 3 + 6 + 10 + 15 - 21 + 28 - 36 = 1 - 3 - 6 + 10 - 15 + 21 + 28 - 36 = 0.
%p b:= proc(n, i) option remember; local m; m:= (2+(3+i)*i)*i/6;
%p `if`(n>m, 0, `if`(n=m, 1,
%p b(abs(n-i*(i+1)/2), i-1) +b(n+i*(i+1)/2, i-1)))
%p end:
%p a:= n-> `if`(irem(n, 4)=1, 0, b(n*(n+1)/2, n-1)):
%p seq(a(n), n=1..40); # _Alois P. Heinz_, Oct 31 2011
%t b[n_, i_] := b[n, i] = With[{m = (2+(3+i)*i)*i/6}, 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]]]]; a[n_] := If[Mod[n, 4] == 1, 0, b[n*(n+1)/2, n-1]]; Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Jan 30 2017, after _Alois P. Heinz_ *)
%Y Cf. A000217.
%K nonn
%O 1,8
%A _Naohiro Nomoto_, Dec 20 2000
%E More terms from _Sascha Kurz_, Oct 13 2001
%E More terms from _Alois P. Heinz_, Oct 31 2011
|