%I #11 Aug 20 2017 23:19:31
%S 1,2,4,3,6,5,10,7,14,8,12,9,15,11,22,13,26,16,18,17,34,19,38,20,24,21,
%T 27,23,46,25,30,28,32,29,58,31,62,33,36,35,40,37,74,39,42,41,82,43,86,
%U 44,48,45,50,47,94,49,56,51,54,52,60,53,106,55,65,57,63
%N Lexicographically earliest permutation of the natural numbers such that all pairs of even- and odd-indexed terms have a common divisor > 1.
%C a(2*n) = smallest number not occurring earlier;
%C a(2*n+1) = smallest number having with a(2*n) a common divisor greater than 1 and not occurring earlier;
%C A227288(n) = gcd(a(n), a(n+1)).
%H Reinhard Zumkeller, <a href="/A227113/b227113.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e . n | a(2n) a(2n+1) | GCD | not occurring after step n
%e . ---+---------------+-----+-------------------------------------------
%e . 0 | _ 1 | _ | {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,..}
%e . 1 | 2 4 | 2 | {3,5,6,7,8,9,10,11,12,13,14,15,16,17,..}
%e . 2 | 3 6 | 3 | {5,7,8,9,10,11,12,13,14,15,16,17,18,19,..}
%e . 3 | 5 10 | 5 | {7,8,9,11,12,13,14,15,16,17,18,19,20,..}
%e . 4 | 7 14 | 7 | {8,9,11,12,13,15,16,17,18,19,20,21,22,..}
%e . 5 | 8 12 | 4 | {9,11,13,15,16,17,18,19,20,21,22,23,24..}
%e . 6 | 9 15 | 3 | {11,13,16,17,18,19,20,21,22,23,24,25,..}
%e . 7 | 11 22 | 11 | {13,16,17,18,19,20,21,23,24,25,26,27,..}
%e . 8 | 13 26 | 11 | {16,17,18,19,20,21,23,24,25,27,28,29,..}
%e . 9 | 16 18 | 2 | {17,19,20,21,23,24,25,27,28,29,30,31,..} .
%o (Haskell)
%o import Data.List (delete)
%o a227113 n = a227113_list !! (n-1)
%o a227113_list = 1 : f [2..] where
%o f (x:xs) = x : y : f (delete y xs)
%o where y : _ = filter ((> 1) . (gcd x)) xs
%Y Cf. A227114 (inverse).
%Y Cf. A101369, A184992.
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, Jul 01 2013
%E Thanks to _Zak Seidov_ (who suggested more elaboration) from _Reinhard Zumkeller_, Jul 05 2013