%I #46 Jan 15 2023 18:40:02
%S 1,2,10,3,100,6,4,20,7,61,5,101,8,53,9,81,21,30,42,52,31,43,71,32,40,
%T 50,62,76,51,63,70,64,54,60,74,82,75,83,65,41,95,87,73,91,102,86,72,
%U 80,98,103,94,104,105,96,106,97,107,108,84,93,85,109,210,200,92
%N Dividing a(n) by the first digit of the next term leaves the next digit as remainder.
%C This is (defined to be) the lexicographically earliest sequence of distinct positive numbers with this property.
%C "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).
%C From _M. F. Hasler_, Mar 03 2021: (Start)
%C 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.
%C 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.
%C This also shows that any term is either a single-digit number, or it has its second digit strictly smaller than its first digit.
%C 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.
%C 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.
%C (End)
%H M. F. Hasler, <a href="/A342158/b342158.txt">Table of n, a(n) for n = 1..5000</a>
%e a(n) divider remainder condition satisfied:
%e 1 2 1 1 = 0*2 + 1
%e 2 1 0 2 = 2*1 + 0
%e 10 3 1 10 = 3*3 + 1
%e 3 1 0 3 = 3*1 + 0
%e 100 6 4 100 = 16*6 + 4
%e 6 4 2 6 = 1*4 + 2
%e 4 2 0 4 = 2*2 + 0
%e 20 7 6 20 = 2*7 + 6
%e 7 6 1 7 = 1*6 + 1
%e 61 8 5 61 = 7*8 + 5
%e 5 1 0 5 = 2*1 + 0
%e 101 8 5 101 = 12*8 + 5
%e 8 5 3 8 = 1*5 + 3
%e 53 9 8 53 = 5*9 + 8
%e 9 8 1 9 = 1*8 + 1
%e ....
%o (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
%Y Cf. A341169.
%K base,nonn,look
%O 1,2
%A _Eric Angelini_ and _M. F. Hasler_, Mar 02 2021
|