OFFSET
0,2
COMMENTS
Integers such as 10, 12, 21, 76, 6792, and 10744 (see A082927) will not appear in the sequence as they contain adjacent digits that differ by 1. Some integers may be disallowed only temporarily; for example, if a(n) = 79, and all nonnegative integers < 79 are already in the sequence, then a(n+1) = 90, because a(n+1) must not start with an 8, as it would differ by 1 from the digit "9" in 79. Now, a(n+2) can equal 80.
LINKS
Gavin Lupo, Table of n, a(n) for n = 0..5000
David A. Corneth, PARI program
EXAMPLE
a(0) = 0.
a(1) = 2. Cannot be 1. Smallest integer that can be placed = 2.
a(2) = 4. Cannot be 1 or 3. Smallest integer that can be placed = 4.
a(3) = 1. Cannot be 3 or 5. Smallest integer that can be placed = 1.
...
(Nonnegative integers < 86, disregarding invalid integers, have already appeared.)
a(74) = 86.
a(75) = 88. Cannot be 87, as it contains adjacent digits that differ by 1. Smallest integer that can be placed = 88.
a(76) = 111. Cannot be 89, 90->99 (9 and 8 differ by 1), or 100->110 (1 and 0 are adjacent and differ by 1). Smallest integer that can be placed = 111.
PROG
(PARI) \\ See PARI link \\ David A. Corneth, Oct 31 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Gavin Lupo and Eric Angelini, Oct 28 2022
STATUS
approved