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.

Showing 1-4 of 4 results.

A329447 Start with a(0)=0; thereafter, look left and identify the least frequent digit d so far (in case of a tie, choose the smallest d): after then a(n) = 10c + d, where c > 0 is the number of times d has appeared so far.

Original entry on oeis.org

0, 10, 11, 20, 12, 22, 30, 13, 23, 33, 40, 14, 24, 34, 44, 50, 15, 25, 35, 45, 55, 60, 16, 26, 36, 46, 56, 66, 70, 17, 27, 37, 47, 57, 67, 77, 80, 18, 28, 38, 48, 58, 68, 78, 88, 90, 19, 29, 39, 49, 59, 69, 79, 89, 99, 100, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 128, 129
Offset: 0

Views

Author

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

Keywords

Comments

The term "10c + d" are to be read "c digits d have appeared so far", as in the "look and see" sequences llike A045918.
It follows immediately from the definition that all terms are distinct. For a sorted list of the terms, see A376779. For a tabular method of computing a(n), see the triangle in A377905. - N. J. A. Sloane, Nov 11 2024
An analogous sequence may be obtained for any initial term a(0). Sequence A329448 lists the starting values that will appear a second time later in the respective sequence.

Crossrefs

Cf. A045918 (describe n), A005150 (the classic "Say What You See"), A139282 (count vowels so far), A139097 (count letters so far).
A376779 gives terms in increasing order. See also A377905.

Programs

  • Maple
    a[0]:= 0;
    S[0]:= 1:
    for i from 1 to 9 do S[i]:= 0 od:
    for n from 1 to 100 do
      a[n]:= min(select(`>=`,[seq(10*S[i]+i, i=0..9)],10));
      L:= convert(a[n],base,10);
      for d from 0 to 9 do S[d]:= S[d] + numboccur(d,L) od;
    od:
    seq(a[n],n=0..100); # Robert Israel, Nov 14 2019
  • PARI
    A329447_vec(N)={my(c=Vec(1,10),t); vector(N,i, for(j=1, #i=vecsort(c,,1), if(c[i[j]], i=i[j];break)); for(j=1, #i=digits(t=c[i]*10+i-1), c[i[j]+1]++);t)} \\ Returns the vector a(1..N)
    
  • Python
    from itertools import islice
    def agen():  # generator of terms
        counts = [1] + [0 for i in range(1, 10)]
        yield 0
        while True:
            m = float('inf')
            for i in range(10):
                if counts[i] and counts[i] < m:
                    m, argm = counts[i], i
            an = 10*m + argm
            yield an
            for d in str(an): counts[int(d)] += 1
    print(list(islice(agen(), 72))) # Michael S. Branicky, Nov 11 2024

Extensions

Edited by N. J. A. Sloane, Nov 10 2024

A327036 a(0)=0; for n > 0, a(n) is the number of distinct digit strings that occur at least twice (not counting overlapping occurrences) in the concatenation of all previous terms.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 21, 22, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 33, 36, 36, 37, 38, 38, 39, 40, 40, 41, 43, 44, 47, 47, 48, 49, 49, 51, 51, 54, 55, 58, 58, 59, 60, 60
Offset: 0

Views

Author

Scott R. Shannon, Nov 28 2019

Keywords

Comments

To calculate a(n) take all the terms from a(0) to a(n-1), concatenate them, and then count the distinct digit strings that have at least two nonoverlapping occurrences. For example, if the concatenated terms formed the string '2210102240404' then the next term would be 8 as the strings '0','1','2','4','04','10','22','40' have all occurred at least twice. Note that the string '404' is not counted as its two occurrences overlap.
In the first 20000 terms, the largest increase in consecutive terms is from a(16496) = 45375 to a(16497) = 45410, an increase of 35; the concatenation of a(16496) to the previous terms results in the longest repeated string, '245352453624537'.

Examples

			a(1) = 0 as there have been no repeated strings prior to a(1).
a(2) = 1 as there has been one repeat of '0', which occurs in a(0) and a(1).
a(3) = 1 as only '0' has repeated up to a(2).
a(4) = 2 as now both '0' and '1' have repeated up to a(3).
a(22) = 12 as the strings '0' to '10' have repeated, but '10,10' contains the string '01' which also appears from a(1) to a(2), thus '01' has also repeated.
a(23) = 13 as a(22) = '12' created a repeat of the string '12', with a(3) and a(4). Even though the terms '10,10,12' contain two occurrences of the string '101' they overlap so are not counted. The string '10,12' also contains another '01' but that has already repeated and been counted previously so is ignored as the count is of distinct strings.
		

Crossrefs

Cf. A330015 (same sequence, but overlapping instances of the same digit string are counted among the repeats).

A330015 a(0) = 0; for n > 0, a(n) is the number of distinct digit strings that occur at least twice (including any overlapping occurrences) in the concatenation of all previous terms.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 12, 14, 14, 15, 17, 17, 18, 20, 20, 21, 24, 24, 25, 27, 27, 28, 30, 30, 31, 33, 34, 36, 36, 37, 39, 39, 40, 40, 41, 43, 45, 46, 46, 47, 49, 49, 51, 52, 54, 56, 57, 57, 58, 60, 60, 61, 63, 63, 65, 67, 68, 68, 70, 70, 71, 73, 75
Offset: 0

Views

Author

Scott R. Shannon, Nov 27 2019

Keywords

Comments

To calculate a(n) take all the terms from a(0) to a(n-1), concatenate them, and then count the distinct digit strings that have at least two occurrences (including any that overlap). For example, if the concatenated terms formed the string '2210102240404' then the next term would be 9 as the strings '0','1','2','4','04','10','22','40','404' have all occurred at least twice. (The two occurrences of '404' overlap.)
In the first 20000 terms, the largest increase in consecutive terms is from a(13058) = 47849 to a(13059) = 47885, an increase of 36, and the concatenation of a(13006) = 47623 to the previous terms results in the longest repeated string, '47611476114761147'.

Examples

			a(1) = 0 as there have been no repeated strings prior to a(1).
a(2) = 1 as there has been one repeat of '0', which occurs in a(0) and a(1).
a(3) = 1 as only '0' has repeated up to a(2).
a(4) = 2 as now both '0' and '1' have repeated up to a(3).
a(22) = 12 as the strings '0' to '10' have repeated, but '10,10' contains the string '01' which also appears from a(1) to a(2), thus '01' has also repeated.
a(23) = 14 as a(22) = '12' created a repeat of the string '12', with a(3) and a(4), and also created an overlapping repeat of the string '101' which is in both '10,10' and '10,12'. Note this later string also contains '01' but that has already repeated and been counted previously so is ignored as the count is of distinct strings.
		

Crossrefs

Cf. A327036 (same sequence, but overlapping instances of the same digit string are not counted among the repeats).

A330027 a(0) = 0; for n > 0, a(n) is the total number of repeated strings in the concatenation of terms a(0) to a(n-1). Repeated strings can overlap.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 12, 16, 18, 20, 22, 25, 28, 30, 32, 34, 38, 40, 42, 44, 47, 50, 52, 55, 59, 62, 64, 66, 69, 72, 74, 76, 79, 82, 85, 88, 91, 96, 99, 103, 112, 118, 125, 130, 134, 140, 144, 150, 155, 161, 168, 173, 177, 183, 188, 194, 199, 205, 210
Offset: 0

Views

Author

Scott R. Shannon, Nov 27 2019

Keywords

Comments

This sequence uses the same rule as A330015 but, instead of the count of unique repeated strings, here the total number of repeated strings seen in the concatenation of a(0) to a(n-1) forms the next term. After a(19) all single digits have been seen, so from that entry all new terms increase the previous term by at least the number of digits in the previous term. In this sequence repeated strings can be overlapping, thus a new entry '444' would add at least two to the total repeated count if '44' was already in the sequence, or at least one otherwise as '444' contains a repeat of '44' itself.

Examples

			a(4) = 2 as both '0' and '1' have repeated in the terms a(0) to a(3).
a(21) = 12, as a(11) = 10 which added another appearance of '0' and '1', so the total repeated string count incremented by two.
a(22) = 16, as a(21) = 12 which added another appearance of '1','2','12','01', so the total repeated string count incremented by four.
		

Crossrefs

Showing 1-4 of 4 results.