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”).

Number of partitions of 2n into two prime parts or two nonprime parts.
2

%I #17 Mar 05 2021 16:50:28

%S 1,1,1,2,4,3,4,6,6,6,8,9,9,9,11,9,13,15,10,14,16,14,16,19,18,17,21,18,

%T 20,25,18,24,27,19,26,28,25,27,32,26,28,35,29,29,39,30,32,38,30,37,41,

%U 35,37,42,38,41,47,40,40,54,38,42,53,39,48,52,46,46

%N Number of partitions of 2n into two prime parts or two nonprime parts.

%H Alois P. Heinz, <a href="/A291563/b291563.txt">Table of n, a(n) for n = 1..20000</a>

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%F a(n) = Sum_{i=1..n} [A010051(i) = A010051(2n-i)], where [] is the Iverson bracket.

%F a(n) = n - A291564(n).

%p a:= n-> n-add(`if`(isprime(n+i) xor isprime(n-i), 1, 0), i=1..n-1):

%p seq(a(n), n=1..80); # _Alois P. Heinz_, Mar 05 2021

%t Table[Sum[KroneckerDelta[(PrimePi[k] - PrimePi[k - 1]), (PrimePi[2 n - k] - PrimePi[2 n - 1 - k])], {k, n}], {n, 80}]

%Y Cf. A010051, A291564.

%K nonn,easy

%O 1,4

%A _Wesley Ivan Hurt_, Oct 20 2017