OFFSET
1,1
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..60.
EXAMPLE
a(1)=9 because there is no prime between 9 and 10.
a(2)=49 because there is no prime between 49 and 51.
a(3)=62 because there is no prime between 62 and 65.
MATHEMATICA
nn = 20; sp1 = 4; t = Table[0, {nn}]; found = 0; fQ[s_] := Union@ PrimeQ[s] == {False}; 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]]; While[found < nn, sp2 = NextSemiPrime[sp1]; d = sp2 - sp1; If[d <= nn && t[[d]] == 0 && fQ[Range[sp1, sp2]], t[[d]] = sp1; found++; Print[{d, sp1}]]; sp1 = sp2]; t (* Robert G. Wilson v, Jun 13 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jack Brennen and Zak Seidov, Dec 23 2007
EXTENSIONS
a(37)-a(40) from Jacques Tramu, Dec 23 2007
STATUS
approved