A376758 The terms of A376201 consist of runs of successive numbers that increase by 1 at each step: a(n) is one-half of length of the n-th such run.
2, 1, 1, 1, 2, 1, 3, 3, 6, 3, 1, 2, 1, 4, 1, 7, 2, 13, 7, 2, 5, 5, 13, 7, 1, 3, 3, 6, 7, 32, 4, 7, 10, 16, 8, 4, 4, 1
Offset: 1
Examples
A376201 begins 1, 2, 3, 4, 11, 12, 27, 28, 59, 60, 123, 124, 125, 126, 255, ... The runs have lengths 4,2,2,4,... so the present sequence begins 2,1,1,2,...
Programs
-
Python
from itertools import count, islice from sympy import isprime, nextprime def A376758_gen(): # generator of terms c, a, p, q = 2, 2, 3, 4 for n in count(3): b = min(p,q) if isprime(a) else (p if a == (p<<1) else q) if b == n: if b == a+1: c += 1 else: yield c>>1 c = 1 if b == p: p = nextprime(p) else: q += isprime(q+1)+1 a = b A376758_list = list(islice(A376758_gen(),10)) # Chai Wah Wu, Oct 14 2024
Extensions
a(33)-a(35) from Michael S. Branicky, Oct 08 2024
a(36)-a(38) from Michael S. Branicky, Oct 15 2024
Comments