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.

A375907 Lexicographically earliest sequence where a(n) is the length of the n-th block of distinct integers sharing a prime factor.

Original entry on oeis.org

2, 4, 3, 6, 2, 4, 3, 6, 2, 3, 6, 2, 4, 8, 10, 3, 6, 5, 10, 2, 4, 3, 6, 2, 3, 6, 2, 4, 8, 10, 3, 6, 5, 10, 2, 3, 6, 2, 4, 8, 10, 3, 6, 5, 10, 2, 4, 3, 6, 2, 4, 8, 10, 5, 15, 2, 4, 6, 3, 9, 12, 8, 10, 5, 15, 2, 4, 6, 5, 10, 2, 4, 6, 3, 2, 4, 6, 3, 9, 2, 4, 6, 3, 9, 12, 8, 10, 5, 15, 2, 4, 3, 6, 2, 4
Offset: 1

Views

Author

Bryle Morga, Sep 02 2024

Keywords

Comments

Does every positive integer > 1 appear eventually?

Examples

			The sequence and blocks begin
  n    = 1 2  3 4 5 6  7 8 9 ...
  a(n) = 2,4, 3,6,2,4, 3,6,2, 3,6,2,4,8,10, 3,6, ...
  block  \-/  \-----/  \---/  \----------/  \-/
  length  2      4       3         6         2   ...
a(7) = 3 is the start of a new block since it has no common factor with the preceding a(6) = 4.
The block lengths are the sequence itself.
		

Programs

  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        n, an, alst = 1, 2, [-3]
        while True:
            b = [next(i for i in count(2) if gcd(i, alst[-1])==1)]
            for i in range(an-1):
                b += [next(j for j in count(2) if j not in b and gcd(j, b[-1])!=1)]
            yield from b
            alst.extend(b)
            n, an = n+1, alst[n+1]
    print(list(islice(agen(), 95))) # Michael S. Branicky, Sep 02 2024