OFFSET
1,9
LINKS
Eric Weisstein's World of Mathematics, Goldbach Partition
Wikipedia, Goldbach's conjecture
FORMULA
a(n) = Sum_{k=1..n} sign( ((pi(k)+1) mod 2) * (pi(2*n-k) mod 2) + (pi(k) mod 2) * ((pi(2*n-k)+1) mod 2) ) * c(k) * c(2*n-k), where c(n) is the prime characteristic.
EXAMPLE
a(12) = 3; 2*12 = 24 has 3 Goldbach partitions with one even-indexed prime and one odd-indexed prime: (19,5), (17,7) and (13,11). For example, 19 is the 8th prime and 5 is the 3rd prime, 17 is the 7th prime and 7 is the 4th prime, and 13 is the 6th prime while 11 is the 5th prime.
MATHEMATICA
Table[Sum[Sign[Mod[PrimePi[k] + 1, 2] Mod[PrimePi[2 n - k], 2] + Mod[PrimePi[k], 2] Mod[PrimePi[2 n - k] + 1, 2]] (PrimePi[k] - PrimePi[k - 1]) (PrimePi[2 n - k] - PrimePi[2 n - k - 1]), {k, n}], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jun 04 2021
STATUS
approved