OFFSET
0,4
FORMULA
a(n) = [x^n] Product_{k > 0} (1 + f(k)*x^k), where f(1) = f(2) = 1, and for m >= 3, f(m) = f(f(m-2)) + r(m), where r(m) = f(f(floor(m/3)) when m == 0 or 1 (mod 3) and = f(m - f(floor(m/3))) when m == 2 (mod 3).
MATHEMATICA
f[0] = 0; f[1] = 1; f[2] = 1;
f[n_] := f[n] = f[f[n - 2]] + If[Mod[n, 3] == 0, f[f[n/3]], If[Mod[n, 3] == 1, f[f[(n - 1)/3]], f[n - f[(n - 2)/3]]]];
P[x_, n_] := P[x, n] = Product[1 + f[m] x^m, {m, 0, n}];
Take[CoefficientList[P[x, 45], x], 45]
(* Program edited and corrected by Petros Hadjicostas, Apr 12 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Nov 17 2008
EXTENSIONS
Various sections edited by Petros Hadjicostas, Apr 12 2020
STATUS
approved