login
a(n) = smallest k such that the digits of exactly n nonnegative numbers are a subsequence of the digits of k.
1

%I #9 Nov 08 2016 20:08:18

%S 0,11,10,100,101,102,120,1002,1022,1012,1021,1023,1201,1203,1230,

%T 10023,10121,10120,10201,10123,10232,10213,10231,10234,12132,12013,

%U 12031,12034,12301,12304,12340,100234,101201,101213,101232,101203,101231,101230,102031,101234,102132,102130,102301,102134,102342

%N a(n) = smallest k such that the digits of exactly n nonnegative numbers are a subsequence of the digits of k.

%H David W. Wilson, <a href="/A275782/b275782.txt">Table of n, a(n) for n = 1..1024</a>

%e The digits of exactly 19 numbers are a subsequence of 10201: 0, 1, 2, 10, 11, 12, 20, 21, 100, 101, 102, 120, 121, 201, 1001, 1020, 1021, 1201, and 10201. No number smaller than 10201 has this property. Hence a(19) = 10201.

%t t = Table[Length@ Union@ Map[FromDigits, Subsets@ IntegerDigits@ n /. {} -> Nothing], {n, 0, 103000}]; Table[FirstPosition[t, n] - 1, {n, Max@ t}] // Flatten (* _Michael De Vlieger_, Aug 08 2016, Version 10.2 *)

%K nonn,base

%O 1,2

%A _David W. Wilson_, Aug 08 2016