OFFSET
2,3
COMMENTS
Number of partitions of n into 2 noncomposite numbers, A008578. - Antti Karttunen, Dec 13 2021
LINKS
Antti Karttunen, Table of n, a(n) for n = 2..20000
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
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Feb 24 2021
STATUS
approved