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”).

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.
1
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,1
COMMENTS
[At present it is only a conjecture that the runs have even length, but the proof should not be difficult.]
EXAMPLE
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,...
PROG
(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
CROSSREFS
Sequence in context: A206487 A209062 A167204 * A304750 A104306 A074389
KEYWORD
nonn,more
AUTHOR
N. J. A. Sloane, Oct 07 2024
EXTENSIONS
a(33)-a(35) from Michael S. Branicky, Oct 08 2024
a(36)-a(38) from Michael S. Branicky, Oct 15 2024
STATUS
approved