%I #13 Apr 25 2015 11:26:49
%S 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,
%T 21,24,29,58,31,62,28,30,25,35,37,74,32,36,41,82,43,86,40,42,47,94,44,
%U 33,27,39,53,106,48,45,50,52,59,118,61,122,54,51,57,60,67
%N 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).
%C Since limsup(prime(n)) is infinity, it is easy to see that the sequence contains all even numbers. So it is natural to conjecture that the sequence is a permutation of the positive integers.
%H Peter J. C. Moses, <a href="/A257405/b257405.txt">Table of n, a(n) for n = 1..1000</a>
%t seq={1};Do[cmplSeq=Complement[Range[2*Max[seq]],seq];
%t 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 *)
%Y Cf. A000040, A064413, A257311, A257312, A257313, A257314, A257315.
%K nonn
%O 1,2
%A _Vladimir Shevelev_, Apr 22 2015
%E More terms from _Peter J. C. Moses_, Apr 22 2015