A062303 Number of ways writing the n-th prime as a sum of two nonprimes.
1, 0, 1, 1, 1, 2, 2, 3, 3, 5, 6, 7, 8, 9, 9, 11, 13, 14, 15, 16, 17, 18, 19, 21, 24, 25, 26, 26, 27, 27, 33, 34, 36, 37, 40, 41, 42, 44, 45, 47, 49, 50, 53, 54, 54, 55, 59, 64, 65, 66, 66, 68, 69, 72, 74, 76, 78, 79, 80, 81, 82, 85, 91, 92, 93, 93, 99, 101, 105, 106, 106, 108
Offset: 1
Keywords
Examples
n=10,p(10)=29 has 14 partitions of form a+b=29; 1+28=4+25=8+21=9+20=14+15 are the 5 relevant partitions, so a(10)=5.
Programs
-
Mathematica
Table[c = 0; Do[If[i + j == Prime[n] && ! PrimeQ[i] && ! PrimeQ[j], c = c + 1], {i, Prime[n] - 1}, {j, i}]; c, {n, 72}] (* Jayanta Basu, Apr 22 2013 *) cnpQ[{a_,b_}]:=(!PrimeQ[a]&&CompositeQ[b])||(!PrimeQ[b]&&CompositeQ[a]); Join[{1},Table[Length[Select[IntegerPartitions[Prime[n],{2}],cnpQ]],{n,2,80}]] (* Harvey P. Dale, Sep 30 2018 *)
Extensions
Offset and name corrected by Sean A. Irvine, Mar 25 2023