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!)
A124936 Numbers k such that k - 1 and k + 1 are semiprimes. 19

%I #28 Nov 26 2022 12:09:59

%S 5,34,50,56,86,92,94,120,122,142,144,160,184,186,202,204,214,216,218,

%T 220,236,248,266,288,290,300,302,304,320,322,328,340,392,394,412,414,

%U 416,446,452,470,472,516,518,528,534,536,544,552,580,582,590,634,668

%N Numbers k such that k - 1 and k + 1 are semiprimes.

%C All but the first term are even.

%H Zak Seidov, <a href="/A124936/b124936.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A092207(n) + 1; at n>=2, a(n) = 2*A082130(n-1).

%t lst={};Do[If[Plus@@Last/@FactorInteger[n-1]==2&&Plus@@Last/@FactorInteger[n+1]==2,AppendTo[lst,n]],{n,7!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Feb 01 2009 *)

%t Select[Range[2, 700], PrimeOmega[# + 1] == PrimeOmega[# - 1] == 2 &] (* _Vincenzo Librandi_, Mar 30 2015 *)

%o (Magma) IsSemiprime:=func< n | &+[k[2]: k in Factorization(n)] eq 2 >; [ n: n in [1..700] | IsSemiprime(n+1) and IsSemiprime(n-1)]; // _Vincenzo Librandi_, Mar 30 2015

%o (PARI) list(lim)=if(lim<5,return([])); my(v=List([5]),x=1,y=1); forfactored(z=7,lim\1+1, if(vecsum(z[2][,2])==2 && vecsum(x[2][,2])==2, listput(v,z[1]-1)); x=y; y=z); Vec(v) \\ _Charles R Greathouse IV_, May 22 2018

%o (Python)

%o from sympy import factorint

%o from itertools import count, islice

%o def agen(): # generator of terms

%o yield 5

%o nxt = 0

%o for k in count(6, 2):

%o prv, nxt = nxt, sum(factorint(k+1).values())

%o if prv == nxt == 2: yield k

%o print(list(islice(agen(), 53))) # _Michael S. Branicky_, Nov 26 2022

%Y Cf. A092207 (k and k+2 are semiprimes), A086005 (k-1, k, k+1 are semiprimes), A086006 (primes p such that 2*p-1 and 2*p+1 are semiprimes), A082130 (2*k-1 and 2*k+1 are semiprimes).

%K nonn

%O 1,1

%A _Zak Seidov_, Nov 13 2006

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 20 00:58 EDT 2024. Contains 371798 sequences. (Running on oeis4.)