login
A341935
a(0) = 0; for n > 0, a(n) is the smallest positive integer not yet in the sequence that can be created by adding 1 or -1, for digits > 0, to every digit in a(n-1).
1
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 12, 23, 14, 25, 16, 27, 18, 29, 38, 47, 36, 45, 34, 43, 32, 41, 30
OFFSET
0,3
COMMENTS
The sequence is finite. After twenty-nine terms a(28) = 30 is reached after which no integer can be created that has not previously occurred. See the examples.
EXAMPLE
a(1) = 1 as a(0) = 0 and the only number that can be created, since 0 can only be added to, is 0 + 1 = 1.
a(10) = 10 as a(9) = 9 and the two number that can be created from 9 are 8 and 10, but 8 has already occurred so 10 must be chosen.
a(11) = 21 as a(10) = 10 and the two numbers that can be created from 10 are '01' = 1 and 21, but 1 has already occurred so 21 must be chosen.
a(12) = 12 as (11) = 21 and the four numbers that can be created from 21 are 10, 12, 30, 32. The number 10 has already occurred and 12 is the smallest of the other three possibilities, so 12 is chosen.
a(28) = 30 as a(27) = 41 and the four numbers that can be created from 41 are 30, 32, 50, 52. The number 30 has not previously occurred and is the smallest of the possibilities, so 30 is chosen.
From 30 the two numbers that can be created are 21 and 41, both of which have already occurred, so the sequence terminates.
CROSSREFS
Cf. A341936 (add -1 or 0 or 1), A001477, A000027, A033075, A341002, A331163.
Sequence in context: A306361 A338840 A068861 * A256079 A216556 A331975
KEYWORD
nonn,base,fini,full
AUTHOR
Scott R. Shannon, Feb 23 2021
STATUS
approved