login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A341945
Number of partitions of n into 2 primes (counting 1 as a prime).
12
1, 1, 2, 1, 2, 1, 2, 1, 2, 0, 2, 1, 3, 1, 2, 0, 3, 1, 3, 1, 3, 0, 4, 1, 3, 0, 2, 0, 4, 1, 3, 1, 4, 0, 4, 0, 3, 1, 3, 0, 5, 1, 4, 1, 4, 0, 6, 1, 4, 0, 3, 0, 6, 1, 3, 0, 4, 0, 7, 1, 4, 1, 5, 0, 6, 0, 3, 1, 5, 0, 7, 1, 6, 1, 5, 0, 7, 0, 5, 1, 5, 0, 9, 1, 5, 0, 4, 0, 10
OFFSET
2,3
COMMENTS
Number of partitions of n into 2 noncomposite numbers, A008578. - Antti Karttunen, Dec 13 2021
LINKS
MAPLE
b:= proc(n, i) option remember; series(`if`(n=0, 1,
`if`(i<0, 0, (p-> `if`(p>n, 0, x*b(n-p, i)))(
`if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 3)
end:
a:= n-> coeff(b(n, numtheory[pi](n)), x, 2):
seq(a(n), n=2..90); # Alois P. Heinz, Feb 24 2021
MATHEMATICA
a[n_] := If[2 == n, 1, Module[{s = 0}, For[p = 2, True, p = NextPrime[p], If[p > n-p, Return[s + Boole[PrimeQ[n-1]]], s += Boole[PrimeQ[n-p]]]]]];
Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jan 03 2022, after Antti Karttunen *)
PROG
(PARI) A341945(n) = if(2==n, 1, my(s=0); forprime(p=2, , if(p>(n-p), return(s+isprime(n-1)), s += isprime(n-p)))); \\ Antti Karttunen, Dec 13 2021
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Feb 24 2021
STATUS
approved