A257311 a(1) = 4; a(2) = 5; for n > 2, a(n) is the smallest number of the form prime + 2 not already used which shares a factor with a(n-1).
4, 5, 15, 9, 21, 7, 49, 63, 33, 39, 13, 91, 105, 25, 45, 55, 75, 69, 81, 99, 111, 129, 43, 559, 169, 195, 85, 115, 165, 141, 153, 159, 183, 61, 549, 201, 213, 225, 175, 133, 19, 285, 231, 243, 273, 259, 315, 235, 265, 295, 355, 375, 279, 31, 403, 351, 309, 103
Offset: 1
Keywords
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
f[n_] := Block[{o = 2, 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@ 58 (* Michael De Vlieger, Apr 20 2015 *)
Extensions
More terms from Peter J. C. Moses, Apr 20 2015
Comments