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.

A358406 The index of A358405 where n first appears, or 0 if n never appears.

Original entry on oeis.org

1, 3, 5, 10, 16, 8, 19, 141, 14, 190, 25, 22, 416, 70, 54, 162, 32, 308, 169, 67, 93, 203, 118, 513, 196, 29, 40, 200, 861, 37, 74, 1081, 82, 216, 208, 363, 90, 46, 375, 1675, 1091, 333, 1407, 812, 166, 78, 51, 1099, 115, 193, 1243, 64, 595, 98, 58, 367, 617, 235, 325, 766, 2137, 272, 124
Offset: 0

Views

Author

Scott R. Shannon, Nov 14 2022

Keywords

Comments

See A358405 for further details.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen():
        k, an, first, prev = 0, 0, {0: 1}, {0: 1}
        for n in count(2):
            while k in first: yield first[k]; k += 1
            an1 = 0 if first[an] == n-1 else max(n-1-prev[an], first[an])
            if an1 not in first: first[an1] = prev[an1] = n
            prev[an] = n-1
            an = an1
    print(list(islice(agen(), 63))) # Michael S. Branicky, Nov 14 2022