OFFSET
0,3
COMMENTS
a(n+1)/a(n) tends to 1.87067337504749000600807516613083316430149226... (used Richardson's extrapolation) - Vaclav Kotesovec, Jan 14 2014
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(3) = 4: 1+1+1, 2+1, 1+2, 3, thus we have 4 compositions with the allowed parts.
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, `if`(n<0, 0,
add(a(n-3^i)+a(n-2*3^i), i=0..ilog[3](n))))
end:
seq(a(n), n=0..40); # Alois P. Heinz, Jan 13 2014
MATHEMATICA
a[n_] := a[n] = If[n == 0, 1, If[n < 0, 0, Sum[a[n - 3^i] + a[n - 2*3^i], {i, 0, Log[3, n]}]]];
a /@ Range[0, 40] (* Jean-François Alcover, Nov 07 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, Jan 13 2014
STATUS
approved