A302479 Number of partitions of n into two distinct nonprime parts.
0, 0, 0, 0, 1, 0, 1, 0, 1, 2, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 5, 3, 5, 4, 6, 4, 6, 5, 7, 6, 6, 6, 9, 6, 10, 7, 8, 8, 10, 8, 11, 9, 10, 9, 12, 9, 13, 10, 13, 10, 13, 11, 15, 12, 14, 12, 16, 13, 18, 14, 15, 14, 18, 14, 20, 15, 16, 16, 20, 16, 21, 17, 20, 17
Offset: 1
Examples
a(16) = 3; 16 = 15+1 = 12+4 = 10+6, which are distinct nonprimes.
Links
Crossrefs
Programs
-
Mathematica
Table[Sum[(1 - PrimePi[n - i] + PrimePi[n - i - 1]) (1 - PrimePi[i] + PrimePi[i - 1]), {i, Floor[(n - 1)/2]}], {n, 100}] Table[Length[Select[IntegerPartitions[n,{2}],Length[Union[#]]==2&&Boole[PrimeQ[#]]=={0,0}&]],{n,80}] (* Harvey P. Dale, Dec 28 2023 *)
-
PARI
A302479(n) = sum(k=1,(n-1)\2,!(isprime(k)+isprime(n-k))); \\ Antti Karttunen, Nov 25 2022
Formula
a(n) = Sum_{i=1..floor((n-1)/2)} (1 - c(i)) * (1 - c(n-i)), where c = A010051.