Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A124936
Numbers k such that k - 1 and k + 1 are semiprimes.
19
5, 34, 50, 56, 86, 92, 94, 120, 122, 142, 144, 160, 184, 186, 202, 204, 214, 216, 218, 220, 236, 248, 266, 288, 290, 300, 302, 304, 320, 322, 328, 340, 392, 394, 412, 414, 416, 446, 452, 470, 472, 516, 518, 528, 534, 536, 544, 552, 580, 582, 590, 634, 668
OFFSET
1,1
COMMENTS
All but the first term are even.
FORMULA
a(n) = A092207(n) + 1; at n>=2, a(n) = 2*A082130(n-1).
MATHEMATICA
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 *)
Select[Range[2, 700], PrimeOmega[# + 1] == PrimeOmega[# - 1] == 2 &] (* Vincenzo Librandi, Mar 30 2015 *)
PROG
(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
(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
(Python)
from sympy import factorint
from itertools import count, islice
def agen(): # generator of terms
yield 5
nxt = 0
for k in count(6, 2):
prv, nxt = nxt, sum(factorint(k+1).values())
if prv == nxt == 2: yield k
print(list(islice(agen(), 53))) # Michael S. Branicky, Nov 26 2022
CROSSREFS
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).
Sequence in context: A193325 A303693 A256373 * A213063 A268281 A223137
KEYWORD
nonn
AUTHOR
Zak Seidov, Nov 13 2006
STATUS
approved