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 ways writing n-th prime as a sum of a prime and a nonprime.
2

%I #14 Jun 25 2019 12:43:59

%S 0,1,0,1,4,3,6,5,8,9,8,11,12,11,14,15,16,15,18,19,18,21,22,23,24,25,

%T 24,27,26,29,30,31,32,31,34,33,36,37,38,39,40,39,42,41,44,43,46,47,48,

%U 47,50,51,50,53,54,55,56,55,58,59,58,61,62,63,62,65,66,67,68,67,70,71,72

%N Number of ways writing n-th prime as a sum of a prime and a nonprime.

%H T. D. Noe, <a href="/A062302/b062302.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A062602(A000040(n)) = number of [nonprime+prime] partitions of prime(n)

%t Table[c = 0; Do[i = Prime[k]; If[i + j == Prime[n] && ! PrimeQ[j], c = c + 1], {k, n - 1}, {j, Prime[n] - 1}]; c, {n, 73}] (* _Jayanta Basu_, Apr 22 2013 *)

%t nn = 100; mx = Prime[nn]; ps = Prime[Range[nn]]; notPs = Complement[Range[mx], ps]; t2 = Table[0, {Range[mx]}]; Do[s = i + j; If[s <= mx, t2[[s]]++], {i, ps}, {j, notPs}]; t2[[ps]] (* _T. D. Noe_, Apr 23 2013 *)

%Y Cf. A061358, A062602, A000040, A014092, A025584.

%K nonn

%O 1,5

%A _Labos Elemer_, Jul 05 2001