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.

This page as a plain text file.
%I A375907 #13 Sep 03 2024 01:06:14
%S A375907 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,
%T A375907 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,
%U A375907 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
%N A375907 Lexicographically earliest sequence where a(n) is the length of the n-th block of distinct integers sharing a prime factor.
%C A375907 Does every positive integer > 1 appear eventually?
%H A375907 Michael S. Branicky, <a href="/A375907/b375907.txt">Table of n, a(n) for n = 1..10000</a>
%e A375907 The sequence and blocks begin
%e A375907   n    = 1 2  3 4 5 6  7 8 9 ...
%e A375907   a(n) = 2,4, 3,6,2,4, 3,6,2, 3,6,2,4,8,10, 3,6, ...
%e A375907   block  \-/  \-----/  \---/  \----------/  \-/
%e A375907   length  2      4       3         6         2   ...
%e A375907 a(7) = 3 is the start of a new block since it has no common factor with the preceding a(6) = 4.
%e A375907 The block lengths are the sequence itself.
%o A375907 (Python)
%o A375907 from math import gcd
%o A375907 from itertools import count, islice
%o A375907 def agen(): # generator of terms
%o A375907     n, an, alst = 1, 2, [-3]
%o A375907     while True:
%o A375907         b = [next(i for i in count(2) if gcd(i, alst[-1])==1)]
%o A375907         for i in range(an-1):
%o A375907             b += [next(j for j in count(2) if j not in b and gcd(j, b[-1])!=1)]
%o A375907         yield from b
%o A375907         alst.extend(b)
%o A375907         n, an = n+1, alst[n+1]
%o A375907 print(list(islice(agen(), 95))) # _Michael S. Branicky_, Sep 02 2024
%K A375907 nonn
%O A375907 1,1
%A A375907 _Bryle Morga_, Sep 02 2024