cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A329448 Numbers n which appear twice in the sequence starting with n and subsequent terms given by 10c + d where c is the number of times (> 0) the least frequent digit d has appeared so far, smallest d in case of tie.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 34, 35, 36, 37, 38, 39, 40, 44, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 66, 67, 68, 69, 70, 77, 78, 79, 80, 88, 89, 90, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 115, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Nov 14 2019

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A329447.

Programs

  • 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])