

A341936


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, 0, or 1, for digits > 0, to every digit in a(n1).


2



0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 28, 27, 26, 25, 24, 23, 22, 21, 20, 30, 31, 32, 33, 34, 35, 36, 37, 38, 29, 39, 48, 47, 46, 45, 44, 43, 42, 41, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 49, 59, 68, 67, 66, 65, 64, 63, 62, 61, 60, 70, 71, 72, 73
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

Each individual digit in a(n1) has either 1,0, or 1 added to it to find the next term. For example 23 can become 12,13,14,22,23,24,32,33,34. Of these options the lowest number not previously seen is then chosen for a(n). A 1 digit becomes 0,1 or 2, a zero digit becomes 0 or 1, while a 9 digit becomes 8,9 or 10 in the next term, e.g. 19 can become 8,9,10,18,19,110,28,29,210. Note that if a leading 1 becomes a 0 it is dropped, along with other leading 0's, for the next term.
The sequence is likely a permutation of the nonnegative integers. The lowest unused number after 1 million terms is 999897.


LINKS

Table of n, a(n) for n=0..72.
Scott R. Shannon, Scatterplot of the first 1 million terms.
Scott R. Shannon, Line graph of the first 1 million terms.


EXAMPLE

a(1) = 1 as a(0) = 0 and the two numbers that can be created from 0 are 0 and 1, since 0 cannot have 1 subtracted. 0 has already occurred so 1 must be chosen.
a(20) = 28 as a(19) = 19 and the nine numbers that can be created from 19 are 8,9,10,18,19,110,28,29,210. The numbers 8,9,10,18,19 have already occurred and 28 is the smallest of the other four possibilities, so 28 is chosen.
a(29) = 30 as a(28) = 20 and the six numbers that can be created from 20 are 10,11,20,21,30,31. The numbers 10,11,20,21 have already occurred and 30 is the smallest of the other two possibilities, so 30 is chosen.
a(1870) = 995 as a(1869) = 1886 and of the 81 possible numbers that can be created from 1886, 995 is the smallest that has not previously occurred. This example shows that the terms can have a large drop in value if the leading digit can decrease by 1.
a(1875) = 8108 as a(1874) = 999 and of the 27 possible numbers that can be created from 999, 8108 is the smallest that has not previously occurred. This example shows that the terms can have a large increase in value if any of its 9 digits are forced to increase to 10.


MATHEMATICA

Nest[Block[{a = #, n = #[[1]]}, Append[a, SelectFirst[Union@ Map[FromDigits@ DeleteCases[Flatten@ IntegerDigits[IntegerDigits[n] + #], _?(AnyTrue[#, # < 0 &] &)] &, Tuples[{1, 0, 1}, IntegerLength[n]]], FreeQ[a, #] &]]] &, {0, 1}, 71] (* Michael De Vlieger, Feb 27 2021 *)


CROSSREFS

Cf. A341935 (add 1 or 1), A001477, A000027, A033075, A341002, A331163.
Sequence in context: A250244 A249816 A250243 * A066566 A256577 A067080
Adjacent sequences: A341933 A341934 A341935 * A341937 A341938 A341939


KEYWORD

nonn,base


AUTHOR

Scott R. Shannon, Feb 23 2021


STATUS

approved



