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.

A375758 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, the initial digit of n divides a(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, 24, 26, 28, 30, 32, 34, 36, 38, 21, 27, 33, 39, 42, 45, 48, 51, 54, 57, 40, 44, 52, 56, 60, 64, 68, 72, 76, 80, 25, 35, 50, 55, 65, 70, 75, 85, 90, 95, 66, 78, 84, 96, 102, 108, 114
Offset: 1

Views

Author

Rémy Sigrist, Aug 26 2024

Keywords

Comments

This sequence is a permutation of the positive integers with inverse A375759.

Examples

			The first terms are:
  n   a(n)  a(n)/A30(n)  |  n   a(n)  a(n)/A30(n)
  --  ----  -----------  |  --  ----  -----------
   1     1            1  |  16    16           16
   2     2            1  |  17    17           17
   3     3            1  |  18    18           18
   4     4            1  |  19    19           19
   5     5            1  |  20    20           10
   6     6            1  |  21    22           11
   7     7            1  |  22    24           12
   8     8            1  |  23    26           13
   9     9            1  |  24    28           14
  10    10           10  |  25    30           15
  11    11           11  |  26    32           16
  12    12           12  |  27    34           17
  13    13           13  |  28    36           18
  14    14           14  |  29    38           19
  15    15           15  |  30    21            7
		

Crossrefs

Cf. A000030, A308539, A375759 (inverse).

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)
            yield an
            aset.add(an)
            while m in aset: m += 1
    print(list(islice(agen(), 67))) # Michael S. Branicky, Jan 27 2025