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.

A109167 a(n) = least nonnegative integer such that n appears a(n) times.

Original entry on oeis.org

1, 2, 1, 0, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18
Offset: 0

Views

Author

Rick L. Shepherd, Jun 20 2005

Keywords

Comments

The concatenation of the first four terms' (decimal) digits gives 1210 = A046043(1).

Examples

			Note that we do not need to specify a(0) explicitly. Indeed, a(0) = 1 as it cannot be 0. a(1) = 2 as it cannot be 0 or 1.
		

Crossrefs

Cf. A046043 (Autobiographical numbers), A001462 (Golomb's sequence).

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        alst = [1, 2, 1, 0, 4, 4, 4, 4]
        yield from alst
        for n in count(5):
            add = [n]*alst[n]
            yield from add
            alst.extend(add)
    print(list(islice(agen(), 79))) # Michael S. Branicky, Aug 25 2025