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!)
A174649 Numbers k such that semiprime(k)+/-1 are both semiprime. 1

%I #10 Dec 29 2021 05:55:58

%S 12,29,33,41,47,64,70,73,96,124,137,194,211,254,277,308,333,372,395,

%T 416,471,507,529,544,560,573,602,624,637,657,672,687,696,716,752,764,

%U 767,869,949,1003,1025,1069,1079,1090,1176,1212,1242,1261,1343,1523,1553

%N Numbers k such that semiprime(k)+/-1 are both semiprime.

%H Michael S. Branicky, <a href="/A174649/b174649.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 12 because 12th semiprime = 2*17, 2*17-1 = 3*11 and 2*17+1 = 5*7;

%e a(2) = 29 because 29th semiprime = 2*43, 2*43-1 = 5*17 and 2*43+1 = 3*29.

%t Flatten[Position[Select[Range[7000],PrimeOmega[#]==2&],_?(PrimeOmega[#-1] == PrimeOmega[#+1]==2&)]] (* _Harvey P. Dale_, Dec 18 2012 *)

%o (Python)

%o from sympy import factorint

%o from itertools import count, islice

%o def semiprimes():

%o for i in count(1):

%o if sum(factorint(i).values()) == 2:

%o yield i

%o def agen():

%o g = semiprimes()

%o prevsp, sp, nextsp = next(g), next(g), next(g)

%o for k in count(2):

%o if nextsp - prevsp == 2:

%o yield k

%o prevsp, sp, nextsp = sp, nextsp, next(g)

%o print(list(islice(agen(), 51))) # _Michael S. Branicky_, Dec 29 2021

%Y Cf. A001358.

%K nonn

%O 1,1

%A _Juri-Stepan Gerasimov_, Mar 25 2010

%E Corrected by _Ray Chandler_, Apr 06 2010

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 August 3 13:42 EDT 2024. Contains 374894 sequences. (Running on oeis4.)