OFFSET
1,1
COMMENTS
Generated by n = 1, 2, 4, 5, 8, 9, 13, 15, 34, 42, 43, 57, 90, 99, 105, 112, 131, 136, 145, 153, 170, 184, ...
EXAMPLE
4 is in this sequence because A001358(1) + 2^1 = 6 is also semiprime.
MATHEMATICA
NextSemiPrime[n_, k_: 1] := Block[{c = 0, sgn = Sign[k]}, sp = n + sgn; While[c < Abs[k], While[ PrimeOmega[sp] != 2, If[sgn < 0, sp--, sp++]]; If[ sgn < 0, sp--, sp++]; c++]; sp + If[sgn < 0, 1, -1]]; SemiPrimePi[n_] := Sum[ PrimePi[ n/Prime[i]] - i + 1, {i, PrimePi[ Sqrt[ n]] }]; sp = 4; lst = {}; While[ sp < 1001, If[ PrimeOmega[sp + 2^SemiPrimePi@ sp] == 2, AppendTo[lst, sp]; Print@ sp]; sp = NextSemiPrime@ sp; c++]; lst (* Robert G. Wilson v, Jun 20 2014 *)
PROG
(PARI)
list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
sp=list(700); s=[]; for(n=1, #sp, if(bigomega(sp[n]+2^n)==2, s=concat(s, sp[n]))); s \\ Colin Barker, Jun 05 2014
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Juri-Stepan Gerasimov, Jun 05 2014
EXTENSIONS
One term inserted, and more terms from Colin Barker, Jun 05 2014
STATUS
approved