A257314 a(1) = 18; a(2) = 19; for n > 2, a(n) is the smallest number of the form prime + 16 not already used which shares a factor with a(n-1).
18, 19, 57, 21, 27, 33, 39, 45, 35, 63, 69, 23, 207, 75, 87, 29, 435, 95, 105, 77, 99, 117, 123, 129, 147, 119, 153, 165, 125, 155, 195, 143, 209, 285, 183, 189, 213, 243, 249, 83, 1079, 273, 245, 215, 255, 267, 89, 623, 287, 329, 47, 893, 323, 399, 279, 297
Offset: 1
Keywords
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
f[n_] := Block[{o = 16, s, p, k}, s = {o + 2, o + 3}; For[k = 3, k <= n, k++, p = 2; While[GCD[p + o, s[[k - 1]]] == 1 || MemberQ[s, p + o], p = NextPrime@ p]; AppendTo[s, p + o]]; s]; f@ 56 (* Michael De Vlieger, Apr 20 2015 *)
Extensions
More terms from Peter J. C. Moses, Apr 20 2015
Comments