Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #9 Nov 28 2023 08:39:30
%S 1,4,54,8422,464862602,7134230598346156958,
%T 13246386641663595526163132113862494582602,
%U 643152870463337226096381089442329605982736165294243832777767297119502149008481206286
%N Number of nodes at n-th level in tree in which top node is 1; each node k has children labeled 1, 2, ..., (k+1)^2 at next level.
%C See the reference in A058311 for a better way to compute this!
%p M:=3;
%p L[0]:=[1]; a[0]:=1;
%p for n from 1 to M do
%p L[n]:=[];
%p t1:=L[n-1];
%p tc:=nops(t1);
%p for i from 1 to tc do
%p t2:=t1[i];
%p for j from 1 to (t2+1)^2 do
%p L[n]:=[op(L[n]),j]; od:
%p a[n]:=nops(L[n]);
%p #lprint(n,L[n],a[n]);
%p od:
%p od:
%p [seq(a[n],n=0..M)];
%p p := proc(n,k) option remember; local j ; if n = 1 then (k+1)^2; else sum( procname(n-1,j),j=1..(k+1)^2) ; fi; expand(%) ; end: A147780 := proc(n) if n = 0 then 1 ; else subs(k=1, p(n,k)) ; fi; end: for n from 0 do printf("%d,\n", A147780(n)) ; od: # _R. J. Mathar_, May 04 2009
%t p[n_, k_] := p[n, k] = If[n == 1, (k + 1)^2, Sum[p[n - 1, j], {j, 1, (k + 1)^2}]];
%t a[n_] := a[n] = If[n == 0, 1, p[n, 1]];
%t Table[Print[n, " ", a[n]]; a[n], {n, 0, 5}] (* _Jean-François Alcover_, Nov 28 2023, after _R. J. Mathar_ *)
%Y A variant of A058311. Cf. A147794.
%K nonn
%O 0,2
%A _N. J. A. Sloane_, May 03 2009
%E 4 more terms from _R. J. Mathar_, May 04 2009