OFFSET
1,1
COMMENTS
Sequence A329447 is defined as above with n = 0, but one can take any other initial term n. This sequence lists those n which reappear later in the resulting sequence. To know whether n reappears, it is sufficient to compute the sequence up to the point where the last digit of n has appeared at least n/10 times. (The sequence may be not strictly increasing, but each subsequence of terms ending in the same digit is, ignoring the initial term.)
There are 369 integers < 1000 and 2696 integers < 10^4 in this sequence.
All powers of 10 appear to be in the sequence, but this is only verified up to 10^7, not proved in general.
LINKS
Eric Angelini, Look left and say, Nov 14 2019.
EXAMPLE
Single-digit numbers cannot reappear: all terms are of the form 10c + d, c > 0.
10 does reappear, because after this initial value, the next term is 10 for "one '1' [appeared so far]".
11 does not reappear, because after this initial value, the digit 1 has appeared already twice, and a term 11 would mean that only "one 1" would have appeared so far.
The numbers n = 12, ..., 19 reappear because they are, as initial term, followed by 11 for "one '1' [has appeared so far]"; thereafter the second digit of n will be the least frequent one, having appeared once, so the next term will be n for "one (second digit of n) [has appeared so far]".
The number 20 reappears because it is followed by 10 (one '0'), then 11 (one '1'), then 12 (one '2'), and then 20 (two '0's).
The number 21 does not reappear because it is followed by 11 (one '1'); at this point three '1's have already appeared and we can never again have 21 meaning that only "two '1's" have appeared so far.
PROG
(PARI) select( is(n)={my(c=Vec(0, 10), t=-n, i, n0=n%10+1, n1=n\10); while(t!=n&&c[n0]<=n1, for(j=1, #i=vecsort(c, , 1), if(c[i[j]], t=c[i[j]]*10+i[j]-1; break)); for(j=1, #i=digits(t), c[i[j]+1]++)); t==n&&n}, [0..130])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Nov 14 2019
STATUS
approved