login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A375907
Lexicographically earliest sequence where a(n) is the length of the n-th block of distinct integers sharing a prime factor.
1
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,1
COMMENTS
Does every positive integer > 1 appear eventually?
LINKS
EXAMPLE
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.
PROG
(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
CROSSREFS
Sequence in context: A256640 A239466 A129509 * A375365 A341844 A372713
KEYWORD
nonn
AUTHOR
Bryle Morga, Sep 02 2024
STATUS
approved