A058311 Number of nodes at n-th level in tree in which top node is 1; each node k has children labeled k, k+1, ..., (k+1)^2 at next level.
1, 4, 48, 7918, 463339346, 7134188685100826388, 13246386641449904934758023373599438217628, 643152870463337226096320122089499144560533929707886143570111588898313745804013188842
Offset: 0
Keywords
Links
- M. Cook and M. Kleber, Tournament sequences and Meeussen sequences, Electronic J. Comb. 7 (2000), #R44.
Programs
-
Maple
M:=4; L[0]:=[1]; a[0]:=1; for n from 1 to M do L[n]:=[]; t1:=L[n-1]; tc:=nops(t1); for i from 1 to tc do t2:=t1[i]; for j from t2 to (t2+1)^2 do L[n]:=[op(L[n]),j]; od: a[n]:=nops(L[n]); #lprint(n,L[n],a[n]); od: od: [seq(a[n],n=0..M)]; # See the reference for a better way to compute this! p := proc(n,k) option remember; local j ; if n = 1 then k^2+k+2; # (k+1)^2-(k-1) else sum( procname(n-1,j),j=k..(k+1)^2) ; fi; expand(%) ; end proc: A058311 := proc(n) if n = 0 then 1 ; else subs(k=1, p(n,k)) ; fi; end proc: for n from 0 do printf("%d,\n", A058311(n)) ; od: # R. J. Mathar, May 04 2009
-
Mathematica
p[n_, k_] := p[n, k] = If[n == 1, k^2+k+2, Sum[p[n-1, j], {j, k, (k+1)^2}]]; a[n_] := If[n == 0, 1, p[n, 1]]; Table[Print[n, " ", a[n]]; a[n], {n, 0, 7}] (* Jean-François Alcover, Jun 26 2023, after R. J. Mathar *)
Extensions
Corrected, with Maple program, by N. J. A. Sloane, May 03 2009. Thanks to Max Alekseyev for pointing out that something was wrong.
Replaced a(4), added three more terms - R. J. Mathar, May 04 2009
Comments