login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A297418
a(n) is the smallest positive number not yet in the sequence that contains the largest digit in a(n-1); a(1)=0.
3
0, 10, 1, 11, 12, 2, 20, 21, 22, 23, 3, 13, 30, 31, 32, 33, 34, 4, 14, 24, 40, 41, 42, 43, 44, 45, 5, 15, 25, 35, 50, 51, 52, 53, 54, 55, 56, 6, 16, 26, 36, 46, 60, 61, 62, 63, 64, 65, 66, 67, 7, 17, 27, 37, 47, 57, 70, 71, 72, 73, 74, 75, 76, 77, 78, 8, 18, 28, 38, 48, 58, 68, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 9, 19, 29
OFFSET
1,2
COMMENTS
Once the digit 9 is introduced in a(82)=89, all following terms must contain a 9.
The sequence contains no fixed points.
Analog sequence formed by taking the smallest digit from a(n-1) is A011540.
LINKS
FORMULA
For n >= 91, a(n) = A011539(n - 81). - Iain Fox, Dec 31 2017
MATHEMATICA
a[n_] := a[n] = Block[{k = 1, s = Union[ IntegerDigits[ a[n -1]]][[-1]], t = Array[a, n - 1]}, While[ MemberQ[t, k] || !MemberQ[ IntegerDigits@ k, s], k++]; k]; a[1] = 0; Array[a, 72] (* Robert G. Wilson v, Dec 30 2017 *)
Nest[Append[#, Block[{m = Max@ IntegerDigits@ Last@ #, k}, k = m; While[Nand[FreeQ[#, k], MemberQ[IntegerDigits[k], m]], k++]; k]] &, {0}, 84] (* Michael De Vlieger, Dec 30 2017 *)
PROG
(PARI) first(n) = my(res = vector(n)); for(x=2, n, if(x == 2, res[x] = 10, for(i=1, +oo, if(!setsearch(Set(res), i) && setsearch(Set(digits(i)), vecmax(digits(res[x-1]))), res[x] = i; break())))); res \\ Iain Fox, Dec 31 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Enrique Navarrete, Dec 29 2017
STATUS
approved