login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062602 Number of ways of writing n = p+c with p prime and c nonprime (1 or a composite number). 14

%I #22 Sep 10 2021 07:31:31

%S 0,0,1,1,0,2,1,2,2,1,4,3,3,3,4,2,6,3,5,4,6,3,8,3,7,4,9,5,9,4,8,7,9,4,

%T 11,3,11,9,10,6,12,5,11,8,12,7,14,5,13,7,15,9,15,6,14,10,16,9,16,5,15,

%U 13,16,8,18,6,18,15,17,9,19,8,18,12,19,11,21,7,21,14,20,13,22,7,21,14

%N Number of ways of writing n = p+c with p prime and c nonprime (1 or a composite number).

%H Donovan Johnson, <a href="/A062602/b062602.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>

%F a(n+1) = SUM(A010051(k)*A005171(n-k+1): 1<=k<=n). [From _Reinhard Zumkeller_, Nov 05 2009]

%F a(n) + A061358(n) + A062610(n) = A004526(n). - _R. J. Mathar_, Sep 10 2021

%e n = 22 has floor(n/2) = 11 partitions of form n = a + b; 3 partitions are of prime + prime [3 + 19 = 5 + 17 = 11 + 11], 3 partitions are of prime + nonprime [2 + 20 = 7 + 15 = 13 + 9], 5 partitions are nonprime + nonprime [1 + 21 = 4 + 18 = 6 + 16 = 8 + 14 = 10 + 12]. So a(22) = 3.

%t Table[Length[Select[Range[Floor[n/2]], (PrimeQ[#] && Not[PrimeQ[n - #]]) || (Not[PrimeQ[#]] && PrimeQ[n - #]) &]], {n, 80}] (* _Alonso del Arte_, Apr 21 2013 *)

%t Table[Length[Select[IntegerPartitions[n,{2}],AnyTrue[#,PrimeQ] && !AllTrue[ #,PrimeQ]&]],{n,90}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 19 2020 *)

%Y Cf. A061358, A014092, A062610, A224712.

%K nonn,easy

%O 1,6

%A _Labos Elemer_, Jul 04 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:33 EDT 2024. Contains 371969 sequences. (Running on oeis4.)