login
Number of n X n arrays of squares of integers with every (n-1) X (n-1) subblock summing to 9.
2

%I #18 Dec 21 2023 12:11:54

%S 40,5670,1311488,139966840,8517111552,256972682203,4498018289528,

%T 52749621622223,457173827246752,3130129802580412,17742633295703592,

%U 86151806412861614,367633855676693776,1406125033775057961,4895690201780964016,15709764651757551137,46932167419266807288

%N Number of n X n arrays of squares of integers with every (n-1) X (n-1) subblock summing to 9.

%H R. H. Hardin, <a href="/A159376/b159376.txt">Table of n, a(n) for n = 3..27</a>

%H <a href="/index/Rec#order_19">Index entries for linear recurrences with constant coefficients</a>, signature (19, -171, 969, -3876, 11628, -27132, 50388, -75582, 92378, -92378, 75582, -50388, 27132, -11628, 3876, -969, 171, -19, 1).

%F a(n) = (213086953*n^18 - 7234157232*n^17 + 109387042419*n^16 - 944291714616*n^15 + 4732047974274*n^14 - 8876879623584*n^13 - 60234921458282*n^12 + 630926806905936*n^11 - 3155566369823715*n^10 + 10733292326883024*n^9 - 26950021111932873*n^8 + 51435177242228136*n^7 - 75424820511654584*n^6 + 85302351200676672*n^5 - 74679591278805264*n^4 + 50936307964412544*n^3 - 26904530479120128*n^2 + 10180065773445120*n - 2048904435916800)/65840947200. - _Robert Israel_, Dec 19 2023

%p G:= proc(s,m)

%p option remember; local t;

%p if s = 9 then t:= m else t:= 0 fi; # 9, 0*

%p if s >= 8 then t:= t + expand(m!/(2*(s-8)!*(m-(s-8)-2)!)) fi; # 4, 4, 1*, 0&*

%p if s >= 4 then t:= t + expand(m!/(s-4)!/(m-(s-4)-1)!) fi; # 4, 1*, 0*

%p t + expand(m!/(s!*(m-s)!)); # 1*, 0*

%p end proc:

%p t:= 0:

%p for a in [0,1,4,9] do

%p for c in [0,1,4,9] do

%p for b from 0 to 9 - max(a,c) do

%p for d from 0 to 9 - a - b do

%p e:= 9 - a - b - d;

%p f:= 9 - b - c - e;

%p if f < 0 then next fi;

%p for g in [0,1,4,9] do

%p h:= 9 - d - e - g;

%p if h < 0 then next fi;

%p i:= 9 - e - f - h;

%p if not member(i, [0,1,4,9]) then next fi;

%p t:= t + G(b,n-2) * G(d,n-2) * G(f,n-2) * G(h,n-2) * G(e,(n-2)^2)

%p od od od od od:

%p Q:= normal(t):

%p seq(Q, n=3..30); # _Robert Israel_, Dec 19 2023

%K nonn,easy

%O 3,1

%A _R. H. Hardin_, Apr 11 2009