A257405 For n=1 or prime, a(n)=n; otherwise, a(n) is the smallest number not already used which shares a factor with a(n-1).
1, 2, 3, 6, 5, 10, 7, 14, 4, 8, 11, 22, 13, 26, 12, 9, 17, 34, 19, 38, 16, 18, 23, 46, 20, 15, 21, 24, 29, 58, 31, 62, 28, 30, 25, 35, 37, 74, 32, 36, 41, 82, 43, 86, 40, 42, 47, 94, 44, 33, 27, 39, 53, 106, 48, 45, 50, 52, 59, 118, 61, 122, 54, 51, 57, 60, 67
Offset: 1
Keywords
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
seq={1};Do[cmplSeq=Complement[Range[2*Max[seq]],seq]; If[PrimeQ[n],AppendTo[seq,n],AppendTo[seq,Min[Select[cmplSeq,GCD[Last[seq],#]>1&]]]],{n,2,100}];seq (* Ivan N. Ianakiev, Apr 25 2015 *)
Extensions
More terms from Peter J. C. Moses, Apr 22 2015
Comments