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”).

A288945
Starting with a(1) = 1, a(n) = smallest nonnegative integer not yet in the sequence such that the first digit of a(n) is the last digit of a(n-1) plus or minus 1, with preference given to -1 when possible. The digit 0 is not allowed.
1
1, 2, 11, 21, 22, 12, 13, 23, 24, 3, 25, 4, 31, 26, 5, 41, 27, 6, 51, 28, 7, 61, 29, 8, 71, 211, 212, 14, 32, 15, 42, 16, 52, 17, 62, 18, 72, 19, 81, 213, 214, 33, 215, 43, 216, 53, 217, 63, 218, 73, 219, 82, 111, 221, 222, 112, 113, 223, 224, 34, 35, 44, 36, 54
OFFSET
1,2
COMMENTS
If a(n-1) ends in 1, a(n) must begin with 2 (i.e., a forced increase by 1).
There are no numbers in the sequence with first digit 9.
EXAMPLE
11 is followed by 21 in the sequence since it can't be followed by a number starting with 0.
CROSSREFS
Cf. A288946.
Sequence in context: A336034 A081242 A071762 * A343450 A245500 A342945
KEYWORD
nonn,base
AUTHOR
Enrique Navarrete, Jun 19 2017
STATUS
approved