login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A157536
Half the number of length n integer sequences with sum zero and sum of squares 32.
1
1, 3, 6, 110, 1095, 7161, 37919, 182367, 860400, 3893395, 17126571, 73368945, 300879670, 1173812745, 4380376770, 15753693858, 54909242667, 186135465987, 614751720490, 1979351435670, 6214975736739, 19042979887371, 57000797449509
OFFSET
2,2
LINKS
Robert Israel and R. H. Hardin, Table of n, a(n) for n = 2..10000 (n = 2..50 from R. H. Hardin)
FORMULA
[cache enabling] count(n,s,ss)->count(n,t,tt) where t=s mod n, q=(t-s)/n, tt=ss+2*q*s+n*q^2; count(n,t,tt)=Sum_{i^2<=tt} count(n-1,t-i,tt-i^2). a(n)=count(n,0,32)/2.
G.f.: (1 - 30*x + 435*x^2 - 3960*x^3 + 25185*x^4 - 118206*x^5 + 420686*x^6 - 1134432*x^7 + 2206965*x^8 - 2665333*x^9 + 3050124*x^10 - 34121034*x^11 + 301563025*x^12 - 1647844221*x^13 + 6443298873*x^14 - 19087013776*x^15 + 43441736331*x^16 - 74712136848*x^17 + 90999467153*x^18 - 61749383676*x^19 - 17226181401*x^20 + 95716380496*x^21 - 106118533542*x^22 + 46133383200*x^23 + 12059750667*x^24 - 19161162021*x^25 + 2427632556*x^26 + 2280934382*x^27 + 225810123*x^28 + 5162259*x^29 + 16214*x^30) * x^2/(1-x)^33. - Robert Israel, Dec 25 2016
MAPLE
g:= proc(n, s, ss) option remember;
if n = 1 then if ss = s^2 then return 1 else return 0 fi fi;
procname(n-1, s, ss) + add(procname(n-1, s-t, ss-t^2)
+procname(n-1, s+t, ss-t^2), t=1..floor(sqrt(ss)));
end proc:
seq(g(n, 0, 32)/2, n=2..50); # Robert Israel, Dec 25 2016
MATHEMATICA
g[n_, s_, ss_] := g[n, s, ss] = If[n == 1, If[ss == s^2, 1, 0], g[n-1, s, ss] + Sum[g[n-1, s-t, ss-t^2] + g[n-1, s+t, ss-t^2], {t, 1, Floor[Sqrt[ss]]}]];
Table[g[n, 0, 32]/2, {n, 2, 50}] (* Jean-François Alcover, Aug 28 2022, after Robert Israel *)
CROSSREFS
Sequence in context: A092680 A101574 A082980 * A046488 A074880 A225884
KEYWORD
nonn
AUTHOR
R. H. Hardin, Mar 02 2009
STATUS
approved