A291564 Number of partitions of 2n into two parts such that one part is prime and the other is nonprime.
0, 1, 2, 2, 1, 3, 3, 2, 3, 4, 3, 3, 4, 5, 4, 7, 4, 3, 9, 6, 5, 8, 7, 5, 7, 9, 6, 10, 9, 5, 13, 8, 6, 15, 9, 8, 12, 11, 7, 14, 13, 7, 14, 15, 6, 16, 15, 10, 19, 13, 10, 17, 16, 12, 17, 15, 10, 18, 19, 6, 23, 20, 10, 25, 17, 14, 21, 22, 17, 20, 19, 12, 23, 24
Offset: 1
Links
Programs
-
Maple
a:= n-> add(`if`(isprime(n+i) xor isprime(n-i), 1, 0), i=1..n-1): seq(a(n), n=1..80); # Alois P. Heinz, Mar 05 2021
-
Mathematica
Table[n - Sum[KroneckerDelta[(PrimePi[k] - PrimePi[k - 1]), (PrimePi[2 n - k] - PrimePi[2 n - 1 - k])], {k, n}], {n, 80}]