Multi-headed Lattice Green Function (N = 5, M = 4)
	Polya Number

NN=5;
MM=4;

Recall some basic definitions in the paper:

(Subscript[P, M,N])(z):=(1/(((2 π))^N))(∫_(-π)^π)...(∫_(-π)^π)(1/(1 - (z/((({{N}, {M}})))) (Subscript[σ, M])(cos (Subscript[θ, 1]), ..., cos (Subscript[θ, N]))))d(Subscript[θ, 1])...d(Subscript[θ, N])

(Subscript[R, M,N])(z):=(Subscript[P, M,N])((2^M)(({{N}, {M}}))z)   and  (Subscript[R, M,N])(z)=(∑_(n≥0))(Subscript[r, M,N])(n)(z^n)

Also, for M odd or M=N, we always have r(2n+1)=0. Hence, define
(Subscript[(OverTilde[r]), M,N])(n):=(Subscript[r, M,N])(2n)  and  (Subscript[(OverTilde[R]), M,N])(z):=(∑_(n≥0))(Subscript[(OverTilde[r]), M,N])(n)(z^n)=(∑_(n≥0))(Subscript[r, M,N])(2n)(z^n) 

Our goal is to find the associated Polya number of the lattice in question.

Command: UnrollRecurrence
Generate a sequence from recurrence & initial values (Koutschan’s implementation).

(* given a recurrence rec in f[n], compute the values {f[0],f[1],...,f[bound]} 
where inits are the initial values {f[0],...,f[d-1]} with d being the order of the recurrence *)
Clear[UnrollRecurrence];
UnrollRecurrence[rec1_,f_[n_],inits_,bound_]:=
Module[{i,x,vals=inits,rec=rec1},
If[Head[rec]=!=Equal,rec=(rec==0)];
rec=rec/.n->n-Max[Cases[rec,f[n+a_.]:>a,Infinity]];
Do[
AppendTo[vals,Solve[rec/.n->i/.f[i]->x/.f[a_]:>vals[[a+1]],x][[1,1,2]]];
,{i,Length[inits],bound}];
Return[vals];
];

Command: SeqLimit
Compute the limit of a convergent sequence (Koutschan’s implementation).

(* Given the first values {f[0],...,f[m]} of a sequence f[n] and a basis of its asymptotic solutions, compute the limit Limit[f[n], n->Infinity]. *)
Clear[SeqLimit];
SeqLimit[data_List,asym_,n_]:=
Module[{c,d=Length[asym],pos,ansatz,sol},
pos=Length[data]+Range[-d,-1];
ansatz=Array[c,d].asym;
sol=Solve[((ansatz/.n->#)==data[[#+1]])&/@pos,Array[c,d]][[1]];
Return[N[c[d]/.sol,200]];
];

Load RISC packages.

<<RISC`HolonomicFunctions`
<<RISC`Asymptotics`
<<RISC`Guess`

HolonomicFunctions Package version 1.7.3 (21-Mar-2017)
written by Christoph Koutschan
Copyright Research Institute for Symbolic Computation (RISC),
Johannes Kepler University, Linz, Austria

Asymptotics Package version 0.3
written by Manuel Kauers
Copyright Research Institute for Symbolic Computation (RISC),
Johannes Kepler University, Linz, Austria

Package GeneratingFunctions version 0.9 written by Christian Mallinger
Copyright Research Institute for Symbolic Computation (RISC),
Johannes Kepler University, Linz, Austria

Guess Package version 0.52
written by Manuel Kauers
Copyright Research Institute for Symbolic Computation (RISC),
Johannes Kepler University, Linz, Austria

ClearAll[Seq];

Load in advance the REC for (Subscript[r, 4,5])(n) in Theorem 4.7 at the end of this file!

Translate the recurrence in term of Ore Polynomials.

RECinS=ToOrePolynomial[REC/.{Seq[k_]->((S[α])^(k-α))}];

Compute the recurrence for the partial Green function: (∑_(0≤n≤(Subscript[n, 0])))(Subscript[r, M,N])(n)((((1/((2^M)(({{N}, {M}}))))))^n).

RECPartialGreeninS=DFiniteTimes[{RECinS},Annihilator[((((1/((2^MM)Binomial[NN,MM]))))^α),S[α]]][[1]]**(S[α]-1);

OrePolynomialDegree[RECPartialGreeninS,S[α]]

RECPartialGreen=ApplyOreOperator[RECPartialGreeninS,Seq[α]];

Compute the initial values of the partial Green function by the values of r and then generate a list.

RIni={1,0,80,0,58320,933120,107360000,4032000000,305742850000,16007947200000,1092754448110080,66052872139161600};
PartialGreenIni=Table[Sum[RIni[[i]]*((((1/((2^MM)Binomial[NN,MM]))))^((i-1))),{i,1,m}],{m,0,Length@RIni}]

Bound=1000;

PartialGreenList=UnrollRecurrence[RECPartialGreen,Seq[α],PartialGreenIni,Bound];

Analyze the asymptotic behavior of the sequence of partial Green function values.

Asymptotics[RECPartialGreen,Seq[α]]

Compute the limit of partial Green function sequence and the associated Polya number.

lim1=SeqLimit[PartialGreenList,Asymptotics[RECPartialGreen,Seq[α],Order->30],α]

lim2=SeqLimit[PartialGreenList,Asymptotics[RECPartialGreen,Seq[α],Order->32],α]

lim1-lim2

1-1/lim2

Load the REC for (Subscript[r, 4,5])(n) in Theorem 4.7.

REC=(2364822061925891270067722649600000+24311763241480737290507853496320000 α+118884714388336585062289753767936000 (α^2)+368251136151853255846369719798988800 (α^3)+811793640582985414140746797028474880 (α^4)+1356499120040750577583138444526223360 (α^5)+1786835040377781128110811754937712640 (α^6)+1904958007246824509445186467125002240 (α^7)+1674545402297600373785511713251000320 (α^8)+1230194808706317371163067050208788480 (α^9)+762791807513049677466384009532538880 (α^10)+402079430499218110643393128200929280 (α^11)+181085303893806582831390648576245760 (α^12)+69909566044762687837271137604075520 (α^13)+23174037389797607720091614796840960 (α^14)+6597237647955223324018009760071680 (α^15)+1610851715462724269782004410613760 (α^16)+336382193033012242367855858810880 (α^17)+59795770083083316221336805703680 (α^18)+8987061025545721077834511810560 (α^19)+1131237375988193565613353861120 (α^20)+117704523870056936584154972160 (α^21)+9941030662497120749554237440 (α^22)+664040244922741425721835520 (α^23)+33746986442943554031452160 (α^24)+1225566587608656091545600 (α^25)+28320365528012449382400 (α^26)+312808771118086225920 (α^27)) Seq[α]+(880540948213763261498004602880000+8086612414279581582690097299456000 α+35535843625080580938628852403404800 (α^2)+99482199073846865130149987053731840 (α^3)+199278215238194877084174219759058944 (α^4)+304147288569704121767283668058636288 (α^5)+367726422460034552713877456306307072 (α^6)+361508986147801089153130211095805952 (α^7)+294331319744750632422172167712997376 (α^8)+201108607972501732293906606562934784 (α^9)+116437788942848727536075769222856704 (α^10)+57524299296878619402424939339382784 (α^11)+24367165878769872656509536747061248 (α^12)+8877402295660764714512245808234496 (α^13)+2785748984068408698625918477467648 (α^14)+752972653647501430958086738673664 (α^15)+175049743314674169771167299534848 (α^16)+34895534864837208484258292957184 (α^17)+5936277532573962980718997929984 (α^18)+855818515821739179539429326848 (α^19)+103560073600267246364541321216 (α^20)+10380185487431012018005475328 (α^21)+846180664706397472693420032 (α^22)+54656640176185180963209216 (α^23)+2690612916385314156576768 (α^24)+94804345329795433758720 (α^25)+2128785749082227343360 (α^26)+22881382331785936896 (α^27)) Seq[1+α]+(-664078540666702251488371015680000-5805956958011506960041778348032000 α-24298272789380152495188221126246400 (α^2)-64810405629301547428216819254558720 (α^3)-123755374367469269296809845353611264 (α^4)-180149375502996189202275648542982144 (α^5)-207865771244125682287781841861722112 (α^6)-195153222041523657876484723267989504 (α^7)-151846270858495120363896477860167680 (α^8)-99230231828276421932960434682314752 (α^9)-54993115047787497911079580675899392 (α^10)-26028017908489825928212462245453824 (α^11)-10572113416646586933511582698766336 (α^12)-3696722231163815760173082026344448 (α^13)-1114468173061041282670805399093248 (α^14)-289688969845746113335461572931584 (α^15)-64831091647102802811533842055168 (α^16)-12454053009083005771527566163968 (α^17)-2043760292966696499523264184320 (α^18)-284532912366921324027166588928 (α^19)-33284416956384385896458223616 (α^20)-3228606478351534833828626432 (α^21)-254974947491313890128560128 (α^22)-15972126457377261067698176 (α^23)-763333007662980725211136 (α^24)-26138887552462651129856 (α^25)-570997443951748710400 (α^26)-5976795675008958464 (α^27)) Seq[2+α]+(36337840931616555318702833664000+310343693247202072877171431833600 α+1268062726217635641408454051430400 (α^2)+3300521955790071740463976232263680 (α^3)+6146984578367464065862054879242240 (α^4)+8723512529514925026222139080468480 (α^5)+9808817646565897068529809213239808 (α^6)+8970447157798999809214350039412224 (α^7)+6796618106855403262931535421469184 (α^8)+4323600610674086572350145316732416 (α^9)+2331860127398843166087931718971904 (α^10)+1073804990271736796663841511156224 (α^11)+424279297446148516898147199947264 (α^12)+144293344557135741340883292465664 (α^13)+42304696119152808149756544291840 (α^14)+10693366157119575923154101714944 (α^15)+2327102570668214059453238664192 (α^16)+434708874971795823099840116736 (α^17)+69373988097051870247906934784 (α^18)+9393304762567159143035764736 (α^19)+1068815757774279757481902080 (α^20)+100861570825855881262923776 (α^21)+7750770733439394600976384 (α^22)+472551963878997639561216 (α^23)+21986541883647884001280 (α^24)+733188729988561502208 (α^25)+15602375112618147840 (α^26)+159149910074064896 (α^27)) Seq[3+α]+(1737772868400007324872130560000+14528609204414291845066255564800 α+58083087258852534411685975019520 (α^2)+147846850915658722383612355430400 (α^3)+269164023324400460962054275740928 (α^4)+373240816513597979905593440661888 (α^5)+409908879949766514326399060864064 (α^6)+366016393873249701940597734061344 (α^7)+270676671846416971917873052917920 (α^8)+168013318310785666403759927887584 (α^9)+88393926598940439065183725045600 (α^10)+39697363634496672642069844386912 (α^11)+15293672611896263618803193519136 (α^12)+5070491874452377148797920831072 (α^13)+1449002022519967409403051116512 (α^14)+356957682436813381749659746304 (α^15)+75700244148872939301421992640 (α^16)+13779371789456905170877563840 (α^17)+2142685081818193152012367872 (α^18)+282685926147777894282083328 (α^19)+31341335886140485043322880 (α^20)+2881942426887984021438464 (α^21)+215812414752103173455872 (α^22)+12823036513484289343488 (α^23)+581508878853457575936 (α^24)+18903053117719314432 (α^25)+392186219850629120 (α^26)+3900964176134144 (α^27)) Seq[4+α]+(-36446102109669030849285120000-301794930778773719063321856000 α-1194401836156084887609064224000 (α^2)-3008156975709477795289491275520 (α^3)-5415770546395539670222530489360 (α^4)-7422453554874065600190474289032 (α^5)-8052206383842449223124682104644 (α^6)-7098162826794167361280152144294 (α^7)-5179144111408801590076035892950 (α^8)-3169950795733038711522140215280 (α^9)-1643499248947095475104215404004 (α^10)-726910788718026537302273862144 (α^11)-275635972025251416199969761656 (α^12)-89889728147001421773544625132 (α^13)-25251994806501150584061125784 (α^14)-6111409098652595993659452026 (α^15)-1272483225563071816917699490 (α^16)-227273250419552627170585084 (α^17)-34655941701831856557922624 (α^18)-4480880404407427210024320 (α^19)-486585842769876461484032 (α^20)-43798304089562788663296 (α^21)-3208710131027557023744 (α^22)-186416522833559945216 (α^23)-8261380192874790912 (α^24)-262301388296421376 (α^25)-5312632953241600 (α^26)-51561082388480 (α^27)) Seq[5+α]+(-154404486709237819219968000-1265327918255018927110348800 α-4953641658930095511385751040 (α^2)-12335446851783544166937390720 (α^3)-21947702123383074616990244544 (α^4)-29712684443300038100072561760 (α^5)-31824626177807101870129360368 (α^6)-27684339638906598652692786888 (α^7)-19923668408873674929361243572 (α^8)-12021754897932453908473126194 (α^9)-6141402912303808338721284327 (α^10)-2675090519652464763702625995 (α^11)-998451712547824111144656513 (α^12)-320337381856256276567115789 (α^13)-88485146094830787771471525 (α^14)-21045641782461353200898049 (α^15)-4304140182149530399276227 (α^16)-754678659252915954749073 (α^17)-112910766050133819763020 (α^18)-14316213223182938203068 (α^19)-1523679350645560062336 (α^20)-134345128624663841280 (α^21)-9635762018738626560 (α^22)-547760583383666688 (α^23)-23739371943886848 (α^24)-736693272182784 (α^25)-14575541944320 (α^26)-138110042112 (α^27)) Seq[6+α];