%I #15 Jan 02 2023 12:30:50
%S 0,1,2,3,4,5,6,7,8,9,10,20,12,30,11,21,13,40,14,15,22,16,17,23,24,50,
%T 18,34,19,25,26,27,31,36,41,37,28,32,29,42,35,60,51,38,33,43,61,39,52,
%U 45,62,46,72,47,53,71,63,56,44,81,73,57,82,48,83,92,102
%N Lexicographically earliest permutation of the natural numbers such that in decimal representation d(n) is contained in a(n), where d is the digit sequence of the concatenation of the a-sequence, cf. A247149.
%C By definition: A247149(n) is contained in a(n).
%H Reinhard Zumkeller, <a href="/A247143/b247143.txt">Table of n, a(n) for n = 0..10000</a>
%H Éric Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2014-November/013974.html">The a(n)th digit of S is present in a(n)</a>, SeqFan list, Nov 20 2014.
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e . n | d(n) | a(n) | n | d(n) | a(n) | n | d(n) | a(n) |
%e . ----+------+------+ -----+------+------+ ------+------+-------+
%e . 10 | 1 | 10 | 100 | 7 | 78 | 1000 | 5 | 885 |
%e . 11 | 0 | 20 | 101 | 1 | 101 | 1001 | 1 | 1040 |
%e . 12 | 2 | 12 | 102 | 6 | 69 | 1002 | 6 | 868 |
%e . 13 | 0 | 30 | 103 | 3 | 133 | 1003 | 3 | 1053 |
%e . 14 | 1 | 11 | 104 | 5 | 105 | 1004 | 3 | 1063 |
%e . 15 | 2 | 21 | 105 | 6 | 86 | 1005 | 5 | 895 |
%e . 16 | 3 | 13 | 106 | 4 | 114 | 1006 | 3 | 1073 |
%e . 17 | 0 | 40 | 107 | 4 | 124 | 1007 | 4 | 945 |
%e . 18 | 1 | 14 | 108 | 8 | 80 | 1008 | 6 | 869 |
%e . 19 | 1 | 15 | 109 | 1 | 106 | 1009 | 5 | 905 |
%e . 20 | 2 | 22 | 110 | 7 | 79 | 1010 | 1 | 1041 |
%e . 21 | 1 | 16 | 111 | 3 | 134 | 1011 | 7 | 876 |
%e . 22 | 1 | 17 | 112 | 5 | 115 | 1012 | 3 | 1083 |
%e . 23 | 3 | 23 | 113 | 7 | 87 | 1013 | 4 | 946 | .
%o (Haskell)
%o import Data.List (delete, find); import Data.Maybe (fromJust)
%o a247143 n = a247143_list !! n
%o a247143_list = [0..10] ++ f 11 (map show [11..]) where
%o f x zss = (read ys :: Int) : f (x + 1) (delete ys zss) where
%o ys = fromJust $ find (elem $ ds !! x) zss
%o ds = concatMap show a247143_list
%Y Cf. A247144 (inverse), A247149 (digits), A247167 (fixed points).
%K nonn,base
%O 0,3
%A _Eric Angelini_ and _Reinhard Zumkeller_, Nov 20 2014