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.

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.

This page as a plain text file.
%I A376758 #15 Oct 15 2024 12:19:22
%S A376758 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,
%T A376758 10,16,8,4,4,1
%N 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.
%C A376758 [At present it is only a conjecture that the runs have even length, but the proof should not be difficult.]
%e A376758 A376201 begins 1, 2, 3, 4, 11, 12, 27, 28, 59, 60, 123, 124, 125, 126, 255, ...
%e A376758 The runs have lengths 4,2,2,4,... so the present sequence begins 2,1,1,2,...
%o A376758 (Python)
%o A376758 from itertools import count, islice
%o A376758 from sympy import isprime, nextprime
%o A376758 def A376758_gen(): # generator of terms
%o A376758     c, a, p, q = 2, 2, 3, 4
%o A376758     for n in count(3):
%o A376758         b = min(p,q) if isprime(a) else (p if a == (p<<1) else q)
%o A376758         if b == n:
%o A376758             if b == a+1:
%o A376758                 c += 1
%o A376758             else:
%o A376758                 yield c>>1
%o A376758                 c = 1
%o A376758         if b == p:
%o A376758             p = nextprime(p)
%o A376758         else:
%o A376758             q += isprime(q+1)+1
%o A376758         a = b
%o A376758 A376758_list = list(islice(A376758_gen(),10)) # _Chai Wah Wu_, Oct 14 2024
%Y A376758 Cf. A376198, A376201.
%K A376758 nonn,more
%O A376758 1,1
%A A376758 _N. J. A. Sloane_, Oct 07 2024
%E A376758 a(33)-a(35) from _Michael S. Branicky_, Oct 08 2024
%E A376758 a(36)-a(38) from _Michael S. Branicky_, Oct 15 2024