OFFSET
1,2
COMMENTS
a(2*n) = smallest number not occurring earlier;
a(2*n+1) = smallest number having with a(2*n) a common divisor greater than 1 and not occurring earlier;
A227288(n) = gcd(a(n), a(n+1)).
LINKS
EXAMPLE
. n | a(2n) a(2n+1) | GCD | not occurring after step n
. ---+---------------+-----+-------------------------------------------
. 0 | _ 1 | _ | {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,..}
. 1 | 2 4 | 2 | {3,5,6,7,8,9,10,11,12,13,14,15,16,17,..}
. 2 | 3 6 | 3 | {5,7,8,9,10,11,12,13,14,15,16,17,18,19,..}
. 3 | 5 10 | 5 | {7,8,9,11,12,13,14,15,16,17,18,19,20,..}
. 4 | 7 14 | 7 | {8,9,11,12,13,15,16,17,18,19,20,21,22,..}
. 5 | 8 12 | 4 | {9,11,13,15,16,17,18,19,20,21,22,23,24..}
. 6 | 9 15 | 3 | {11,13,16,17,18,19,20,21,22,23,24,25,..}
. 7 | 11 22 | 11 | {13,16,17,18,19,20,21,23,24,25,26,27,..}
. 8 | 13 26 | 11 | {16,17,18,19,20,21,23,24,25,27,28,29,..}
. 9 | 16 18 | 2 | {17,19,20,21,23,24,25,27,28,29,30,31,..} .
PROG
(Haskell)
import Data.List (delete)
a227113 n = a227113_list !! (n-1)
a227113_list = 1 : f [2..] where
f (x:xs) = x : y : f (delete y xs)
where y : _ = filter ((> 1) . (gcd x)) xs
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 01 2013
EXTENSIONS
Thanks to Zak Seidov (who suggested more elaboration) from Reinhard Zumkeller, Jul 05 2013
STATUS
approved