OFFSET
1,1
COMMENTS
Similar to A121885, but with smallest semiprime greater than it.
LINKS
Antonio Roldán, Table of n, a(n) for n = 1..1229
EXAMPLE
a(7) = 4, because 17 is the seventh prime and 17+1 = 18 = 2*3^2, 17+2 = 19 = 19 and 17+3 = 20 = 2^2*5 are not semiprimes, but 17+4 = 21 = 3*7 is a semiprime.
MATHEMATICA
SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; Table[i = Prime[n] + 1; While[! SemiPrimeQ[i], i++]; i - Prime[n], {n, 87}] (* T. D. Noe, Oct 08 2012 *)
ssp[p_]:=Module[{k=1}, While[PrimeOmega[p+k]!=2, k++]; k]; Table[ssp[p], {p, Prime[ Range[100]]}] (* Harvey P. Dale, Sep 15 2022 *)
PROG
(PARI) m=0; forprime(n=2, 10000, k=0; while(bigomega(n+k)<>2, k=k+1); m=m+1; write("B217612.txt", m, " ", k)) \\ Antonio Roldán, Oct 08 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Antonio Roldán, Oct 08 2012
STATUS
approved