OFFSET
1,2
COMMENTS
This is (defined to be) the lexicographically earliest sequence of distinct positive numbers with this property.
"First digit to its right" means the first digit of a(n+1); the next digit is then the second digit of a(n+1) (if > 9) or the first digit of a(n+2).
From M. F. Hasler, Mar 03 2021: (Start)
The definition can be written as: For all n >= 1, a(n) == r (mod q) where q > r >= 0 and either a(n+1) = q < 10 and r = first digit of a(n+2), or a(n+1) = (10 q + r)*10^k + m with 0 <= m < 10^k >= 1.
This makes it easy to construct a(n+1) for any given a(n). In particular, one always has a(n+1) <= smallest power of 10 not yet in the sequence.
This also shows that any term is either a single-digit number, or it has its second digit strictly smaller than its first digit.
Therefore the sequence is not a permutation of the natural numbers. Specifically, none of {11, ..., 19, 22, ..., 29, 33, ..., 39, ..., 99, 110, ..., 199, 220, ... 299, ...} (sequence not yet in the OEIS) will ever appear in the sequence.
However, we may conjecture that all other numbers (i.e., all positive integers whose second digit, if it exists, is strictly smaller than the first digit), will eventually appear.
(End)
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..5000
EXAMPLE
a(n) divider remainder condition satisfied:
1 2 1 1 = 0*2 + 1
2 1 0 2 = 2*1 + 0
10 3 1 10 = 3*3 + 1
3 1 0 3 = 3*1 + 0
100 6 4 100 = 16*6 + 4
6 4 2 6 = 1*4 + 2
4 2 0 4 = 2*2 + 0
20 7 6 20 = 2*7 + 6
7 6 1 7 = 1*6 + 1
61 8 5 61 = 7*8 + 5
5 1 0 5 = 2*1 + 0
101 8 5 101 = 12*8 + 5
8 5 3 8 = 1*5 + 3
53 9 8 53 = 5*9 + 8
9 8 1 9 = 1*8 + 1
....
PROG
(PARI) A342158(Nmax=100, s=1, U=[], t)={vector(Nmax, n, /* update list of used/forbidden numbers */ U=setunion(U, [s]); while(#U>1&&U[2]==U[1]+1, U=U[^1]); /* only if previously computed s = a(n) < 10, first digit of next term must equal a(n-1) mod a(n) */ t = if(s>9, 0, t%s); /* now "place" the previously computed a(n) = s and compute the next term: for(...) evaluates to 0 */ s + for(k=U[1]+1, oo, setsearch(U, k) && next /* already used */; my(d=digits(k)); /* first digit OK? */ if(t && d[1] != t, k = t*10^(#d - (d[1]<t))-1; next); if((k>9 && s%d[1]==d[2]) || (k<10 && s%d[1]), t=s; s=k; break)))} \\ M. F. Hasler, Mar 03 2021
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini and M. F. Hasler, Mar 02 2021
STATUS
approved