OFFSET
1,2
COMMENTS
Every lesser of twin primes (A001359) is in the sequence. Every Fermat prime reduced by 1 and every Mersenne prime are in the sequence.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) >> n log^2 n. - Charles R Greathouse IV, Sep 21 2017
EXAMPLE
125 is in the sequence, since omega(125) = 1 and omega(125+2) = 1;
127 is in the sequence, since omega(127) = 1 and omega(127+1) = 1.
MATHEMATICA
Select[Range[3000], PrimeNu[#]<=1&&(PrimeNu[#+1]==1||PrimeNu[#+2]==1)&] (* Peter J. C. Moses, Sep 03 2017 *)
onQ[{a_, b_, c_}]:=a<2&&(b==1||c==1); SequencePosition[PrimeNu[ Range[ 1100]], _?onQ][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 04 2019 *)
PROG
(PARI) isok(n) = (omega(n) <= 1) && ((omega(n+1) == 1) || (omega(n+2)==1)); \\ Michel Marcus, Sep 04 2017
(PARI) is(n)=if(n<6, n>0, isprimepower(n) && (isprimepower(n+2) || isprimepower(n+1))) \\ Charles R Greathouse IV, Sep 21 2017
(PARI) list(lim)=my(v=List([1]), p=3, t); forprime(q=5, lim+2, if(q-p<3, listput(v, p)); p=q); for(e=1, logint(lim\=1, 2), t=2^e; if(isprimepower(t-1), listput(v, t-1)); if(isprimepower(t+1), listput(v, t))); for(e=2, logint(lim, 3), forprime(q=3, sqrtnint(lim, e), t=q^e; if(isprimepower(t-2), listput(v, t-2)); if(isprimepower(t+2), listput(v, t)))); Set(v) \\ Charles R Greathouse IV, Sep 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Sep 03 2017
EXTENSIONS
More terms from R. J. Mathar, Sep 03 2017
STATUS
approved