OFFSET
1,1
COMMENTS
All but the first term are even.
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
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
KEYWORD
nonn
AUTHOR
Zak Seidov, Nov 13 2006
STATUS
approved