OFFSET
0,2
EXAMPLE
a(2) = a(3) = 117 = 9*13 and all the numbers from 117-2 = 115 to 117+2 = 119 are
composite.
MATHEMATICA
f[s_] := Block[{k, n, inc}, n = Length[s]; k = inc = Last[s]; While[Or @@ PrimeQ /@ Range[k - n, k + n], k += inc]; Append[s, k]]; Nest[f, {1}, 30] (* Ray Chandler, Sep 23 2006 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 15 2004
EXTENSIONS
Extended by Ray Chandler, Sep 23 2006
STATUS
approved