OFFSET
0,4
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
FORMULA
EXAMPLE
From Petros Hadjicostas, Apr 10 2020: (Start)
a(1) = f(1) = 1,
a(2) = f(2) = 1,
a(3) = f(3) + f(1)*f(2) = 2 + 1*1 = 3,
a(4) = f(4) + f(1)*f(3) = 3 + 1*2 = 5,
a(5) = f(5) + f(1)*f(4) + f(2)*f(3) = 3 + 1*3 + 1*2 = 8,
a(6) = f(6) + f(1)*f(5) + f(2)*f(4) + f(1)*f(2)*f(3) = 4 + 1*3 + 1*3 + 1*1*2 = 12,
a(7) = f(7) + f(1)*f(6) + f(2)*f(5) + f(3)*f(4) + f(1)*f(2)*f(4) = 5 + 1*4 + 1*3 + 2*3 + 1*1*3 = 21. (End)
MATHEMATICA
(*A005229*) f[n_Integer?Positive] := f[n] = f[ f[n - 2]] + f[n - f[n - 2]]; f[0] = 0; f[1] = f[2] = 1;
P[x_, n_] := P[x, n] = Product[1 + f[m] *x^m, {m, 0, n}];
Take[CoefficientList[P[x, 45], x], 45] (* Program simplified by Petros Hadjicostas, Apr 13 2020 *)
PROG
(PARI) \\ here B(n) is A005229 as vector.
B(n)={my(a=vector(n, i, 1)); for(n=3, n, a[n] = a[a[n-2]] + a[n-a[n-2]]); a}
seq(n)={my(v=B(n)); Vec(prod(k=1, n, 1 + v[k]*x^k + O(x*x^n)))} \\ Andrew Howroyd, Apr 10 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Nov 16 2008
EXTENSIONS
Various sections edited by Joerg Arndt and Petros Hadjicostas, Apr 10 2020
STATUS
approved