OFFSET
0,6
REFERENCES
S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 292-295.
Silvia Heubach and Toufik Mansour, Combinatorics of Compositions and Words, CRC Press, 2010.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2000 (first 501 terms from T. D. Noe)
S. R. Finch, Kalmar's composition constant, June 5, 2003. [Cached copy, with permission of the author]
Philippe Flajolet, More information including asymptotic form (1995). [Broken link]
P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 43, 298
FORMULA
a(n) = Sum_{prime p<=n} a(n-p) with a(0)=1. - Henry Bottomley, Dec 15 2000
G.f.: 1/(1 - Sum_{k>=1} x^A000040(k)). - Andrew Howroyd, Dec 28 2017
EXAMPLE
2; 3; 4 = 2+2; 5 = 2+3 = 3+2; 6 = 2+2+2 = 3+3; 7 = 2+2+3 = 2+3+2 = 3+2+2 = 2+5 = 5+2; etc.
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, add(
`if`(isprime(j), a(n-j), 0), j=1..n))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Feb 12 2021
MATHEMATICA
CoefficientList[ Series[1 / (1 - Sum[ x^Prime[i], {i, 15}]), {x, 0, 45}], x]
PROG
(PARI) {my(n=60); Vec(1/(1-sum(k=1, n, if(isprime(k), x^k, 0))) + O(x*x^n))} \\ Andrew Howroyd, Dec 28 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved