OFFSET
0,6
REFERENCES
H. Gupta, Certain averages connected with partitions. Res. Bull. Panjab Univ. no. 124 1957 427-430.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence in two entries, N0004 and N0039).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000 (terms 0..1000 from T. D. Noe)
Edray Herber Goins and Talitha M. Washington, On the generalized climbing stairs problem, Ars Combin. 117 (2014), 183-190. MR3243840 (Reviewed), arXiv:0909.5459 [math.CO], 2009.
H. Gupta, Partitions into distinct primes, Proc. Nat. Acad. Sci. India, 21 (1955), 185-187. [broken link]
BongJu Kim, Partition number identities which are true for all set of parts, arXiv:1803.08095 [math.CO], 2018.
Vaclav Kotesovec, Plot of log(a(n)) / log(Qas(n)) for n = 2..10^8, for Qas see the formula (25) from the article by Murthy, Brack and Bhaduri, p. 7.
M. V. N. Murthy, M. Brack, R. K. Bhaduri, On the asymptotic distinct prime partitions of integers, arXiv:1904.02776 [math.NT], Mar 22 2019.
K. F. Roth and G. Szekeres, Some asymptotic formulae in the theory of partitions, Quart. J. Math., Oxford Ser. (2) 5 (1954), 241-259.
FORMULA
G.f.: Product_{k>=1} (1+x^prime(k)).
log(a(n)) ~ Pi*sqrt(2*n/(3*log(n))) [Roth and Szekeres, 1954]. - Vaclav Kotesovec, Sep 13 2018
EXAMPLE
n=16 has a(16) = 3 partitions into distinct prime parts: 16 = 2+3+11 = 3+13 = 5+11.
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1)+`if`(ithprime(i)>n, 0, b(n-ithprime(i), i-1))))
end:
a:= n-> b(n, numtheory[pi](n)):
seq(a(n), n=0..100); # Alois P. Heinz, Nov 15 2012
MATHEMATICA
CoefficientList[Series[Product[(1+x^Prime[k]), {k, 24}], {x, 0, Prime[24]}], x]
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i-1] + If[Prime[i] > n, 0, b[n - Prime[i], i-1]]]]; a[n_] := b[n, PrimePi[n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)
nmax = 100; pmax = PrimePi[nmax]; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 0; poly[[3]] = 1; Do[p = Prime[k]; Do[poly[[j]] += poly[[j - p]], {j, nmax + 1, p + 1, -1}]; , {k, 2, pmax}]; poly (* Vaclav Kotesovec, Sep 20 2018 *)
PROG
(Haskell)
a000586 = p a000040_list where
p _ 0 = 1
p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
-- Reinhard Zumkeller, Aug 05 2012
(PARI) a(n, k=n)=if(n<1, !n, my(s); forprime(p=2, k, s+=a(n-p, p-1)); s) \\ Charles R Greathouse IV, Nov 20 2012
(Python)
from sympy import isprime, primerange
from functools import cache
@cache
def a(n, k=None):
if k == None: k = n
if n < 1: return int(n == 0)
return sum(a(n-p, p-1) for p in primerange(1, k+1))
print([a(n) for n in range(83)]) # Michael S. Branicky, Sep 03 2021 after Charles R Greathouse IV
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
Entry revised by N. J. A. Sloane, Jun 10 2012
STATUS
approved