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”).

Half the number of length n integer sequences with sum zero and sum of squares 32.
1

%I #15 Aug 28 2022 08:23:24

%S 1,3,6,110,1095,7161,37919,182367,860400,3893395,17126571,73368945,

%T 300879670,1173812745,4380376770,15753693858,54909242667,186135465987,

%U 614751720490,1979351435670,6214975736739,19042979887371,57000797449509

%N Half the number of length n integer sequences with sum zero and sum of squares 32.

%H Robert Israel and R. H. Hardin, <a href="/A157536/b157536.txt">Table of n, a(n) for n = 2..10000</a> (n = 2..50 from R. H. Hardin)

%F [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.

%F 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

%p g:= proc(n,s,ss) option remember;

%p if n = 1 then if ss = s^2 then return 1 else return 0 fi fi;

%p procname(n-1,s,ss) + add(procname(n-1,s-t, ss-t^2)

%p +procname(n-1,s+t,ss-t^2),t=1..floor(sqrt(ss)));

%p end proc:

%p seq(g(n, 0, 32)/2, n=2..50); # _Robert Israel_, Dec 25 2016

%t 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]]}]];

%t Table[g[n, 0, 32]/2, {n, 2, 50}] (* _Jean-François Alcover_, Aug 28 2022, after _Robert Israel_ *)

%K nonn

%O 2,2

%A _R. H. Hardin_, Mar 02 2009