|
|
A347419
|
|
Number of partitions of n into two or more distinct primes.
|
|
3
|
|
|
0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 0, 2, 1, 2, 2, 3, 1, 4, 2, 4, 4, 4, 4, 5, 5, 6, 5, 6, 6, 6, 8, 7, 9, 9, 9, 11, 10, 11, 13, 12, 13, 15, 14, 17, 16, 18, 18, 20, 21, 23, 22, 25, 25, 27, 30, 29, 32, 32, 34, 37, 38, 40, 42, 44, 45, 50, 49, 53, 55, 57, 60, 64, 66, 70, 71, 76, 78, 83, 86, 89, 93, 96
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,10
|
|
COMMENTS
|
Every positive integer can be written as a sum of two or more distinct primes except 1,2,3,4,6 and 11.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(5) = 1: 2+3.
a(18) = 4: 11+7, 11+5+2, 13+5, 13+3+2.
|
|
MAPLE
|
h:= proc(n) h(n):=`if`(n<2, 0, `if`(isprime(n), n, h(n-1))) end:
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<2, 0,
b(n, h(i-1))+b(n-i, h(min(n-i, i-1)))))
end:
a:= n-> b(n, h(n-1)):
|
|
MATHEMATICA
|
m = 24; Rest @ CoefficientList[Series[Product[(1 + x^Prime[k]), {k, 1, m}], {x, 0, Prime[m]}], x] - Table[Boole @ PrimeQ[n], {n, 1, Prime[m]}] (* Amiram Eldar, Sep 03 2021 *)
|
|
PROG
|
(Python)
from sympy import isprime, primerange
from functools import cache
@cache
if k == None: k = n
if n < 1: return int(n == 0)
return sum(A000586(n-p, p-1) for p in primerange(1, k+1))
def a(n): return A000586(n) - isprime(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|