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.

A380434 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, the initial digit of n divides a(n) or the initial digit of a(n) divides n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 21, 24, 23, 26, 25, 28, 27, 30, 29, 33, 36, 31, 39, 42, 32, 45, 48, 34, 40, 44, 35, 52, 41, 37, 56, 60, 38, 64, 50, 55, 43, 65, 61, 51, 46, 70, 75, 80, 47, 54, 66, 71, 49, 53, 62, 72
Offset: 1

Views

Author

Rémy Sigrist, Jan 24 2025

Keywords

Comments

This sequence is a self-inverse permutation of the positive integers.

Crossrefs

Programs

  • PARI
    \\ See Links section.
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        aset, m = set(), 1
        for n in count(1):
            n1 = int(str(n)[0])
            an = next(k for k in count(m) if k not in aset and (k%n1 == 0 or n%int(str(k)[0]) == 0))
            yield an
            aset.add(an)
            while m in aset: m += 1
    print(list(islice(agen(), 67))) # Michael S. Branicky, Jan 27 2025