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!)
A339708 a(n) is the number of decompositions of 2*n as the sum of an odd prime and a semiprime. 2

%I #19 Dec 15 2020 18:30:32

%S 0,0,0,0,0,1,1,1,1,2,2,1,3,4,1,4,2,2,6,4,3,5,5,2,4,7,4,7,6,3,10,5,4,

%T 10,6,6,7,8,5,9,9,4,8,10,4,11,10,9,13,9,7,10,10,9,10,9,8,11,13,4,16,

%U 13,9,15,11,11,13,14,13,13,10,10,15,16,8,19,11,11,17,14,15,17,18,9,13,17,15

%N a(n) is the number of decompositions of 2*n as the sum of an odd prime and a semiprime.

%H Robert Israel, <a href="/A339708/b339708.txt">Table of n, a(n) for n = 1..5000</a>

%e a(10) = 2 because 20 = 5+15 = 11+9 where 5 and 11 are primes and 15 and 9 are semiprimes.

%p N:= 300: # for a(1)..a(N/2)

%p P:= select(isprime,[seq(i,i=3..N,2)]):

%p S:= sort(select(`<`,[seq(seq(P[i]*P[j],i=1..j),j=1..nops(P))],N)):

%p V:= Vector(N):

%p for p in P do

%p for s in S do

%p v:= p+s;

%p if v>N then break fi;

%p V[v]:= V[v]+1

%p od od:

%p seq(V[i],i=2..N,2);

%t {0}~Join~Array[Count[IntegerPartitions[2 #, {2}, All, -(# - 2)], _?(And[AnyTrue[#, PrimeQ], AnyTrue[#, PrimeOmega[#] == 2 &]] &)] &, 86, 2] (* _Michael De Vlieger_, Dec 13 2020 *)

%o (PARI) a(n) = {my(nb=0); forprime(p=3, 2*n, if (bigomega(2*n-p) == 2, nb++);); nb;} \\ _Michel Marcus_, Dec 14 2020

%Y Cf. A001358, A235645, A339709.

%K nonn,look

%O 1,10

%A _J. M. Bergot_ and _Robert Israel_, Dec 13 2020

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 March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)