OFFSET
1,2
COMMENTS
This is a permutation of the natural numbers as, in building the sequence, we always choose the smallest integer not yet present.
The inverse is A252781. Eric Angelini, Jan 16 2015
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
Éric Angelini, The a(n)th term of S ends with the a(n)th digit of S, SeqFan list, Jan 15 2015.
Paul Tek, PERL program for this sequence
EXAMPLE
Last digits are: (1), (2), (3), (4), (5), (6), (7), (8), (9), 1(1), 2(1), 1(2), 3(1), 4(1), 2(2), 1(3), 5(1), 1(4), 6(1), 3(2), 4(2),... which form (1), (2), (3), (4), (5), (6), (7), (8), (9), (1), (1), (2), (1), (1), (2), (3), (1), (4), (1), (2), (2)... then 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 1, 1, 2, 3, 1, 4, 1, 2, 2,... which can be seen as 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 21, 12, 31, 41, 22,... thus the starting sequence.
PROG
(Haskell)
import Data.List (delete)
a250310 n = a250310_list !! (n-1)
a250310_list = [1..9] ++ [11] ++ f ([0..9] ++ [1, 1]) 11 (10 : [12..])
where f ss i zs = g zs where
g (x:xs) = if ss !! i /= mod x 10
then g xs
else x : f (ss ++ map (read . return) (show x))
(i + 1) (delete x zs)
-- Reinhard Zumkeller, Jan 16 2015
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini, Apr 25 2005, revised Dec 06 2007
EXTENSIONS
Data corrected by Paul Tek, Aug 11 2013
STATUS
approved