login
A302481
Number of partitions of n into two parts with the smaller part prime and the larger part nonprime.
2
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 3, 2, 2, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 4, 3, 6, 4, 6, 3, 5, 4, 5, 3, 7, 3, 7, 6, 7, 5, 8, 4, 7, 5, 7, 5, 9, 4, 8, 5, 9, 6, 9, 4, 8, 6, 9, 6, 10, 4, 9, 8, 10, 6, 11, 5, 11, 9, 10, 6, 11, 5, 10, 7, 11, 7, 12, 5, 12, 8, 11, 8
OFFSET
1,11
FORMULA
a(n) = Sum_{i=1..floor(n/2)} c(i) * (1 - c(n-i)), where c is the prime characteristic (A010051).
EXAMPLE
a(11) = 3; 11 = 9+2 = 8+3 = 6+5, smaller parts are prime, larger nonprime.
MATHEMATICA
Table[Sum[(1 - (PrimePi[n - i] - PrimePi[n - i - 1])) (PrimePi[i] - PrimePi[i - 1]), {i, Floor[n/2]}], {n, 100}]
Table[Count[Boole[PrimeQ[#]&/@IntegerPartitions[n, {2}]], _?(#=={0, 1}&)], {n, 90}] (* Harvey P. Dale, Jan 05 2020 *)
PROG
(PARI) a(n) = sum(i=1, n\2, isprime(i)*(1-isprime(n-i))); \\ Michel Marcus, Apr 09 2018
CROSSREFS
Sequence in context: A085034 A119323 A102299 * A306542 A335171 A259652
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 08 2018
STATUS
approved