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

Lengths of runs of identical terms in A353710.
3

%I #18 May 10 2022 09:55:09

%S 1,1,1,3,8,40,3,20,10,4,95,60,77,227,498,162,438,988,334,946,1342,

%T 13633,1446,810,103,140,7033,2518,2369,5096,1719,300,2397,14590,434,

%U 6539,26193,20403,13857,10,26972,24908,44745,3346,149938,5859,29919,132184,123679

%N Lengths of runs of identical terms in A353710.

%H Rémy Sigrist, <a href="/A353718/b353718.txt">Table of n, a(n) for n = 1..132</a>

%H Rémy Sigrist, <a href="/A353718/a353718.txt">C++ program</a>

%e The first 60 terms of A353710 are 0, / 1, / 2, / 3, 3, 3, / 5, 5, 5, 5, 5, 5, 5, 5, / 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, / 11, 11, 11, / 15, 15, 15, ... The slashes indicate the initial runs of lengths 1, 1, 1, 3, 8, 40, 3, ...

%o (C++) See Links section.

%o (Python)

%o from itertools import count, islice

%o def A353718_gen(): # generator of terms

%o s, a, b, c, ab, k = {0,1}, 0, 1, 2, 1, 1

%o yield from (1,1)

%o while True:

%o for n in count(c):

%o if not (n & ab or n in s):

%o a, b = b, n

%o ab = a|b

%o s.add(n)

%o if c in s:

%o yield k

%o k = 0

%o while c in s:

%o c += 1

%o k += 1

%o break

%o A353718_list = list(islice(A353718_gen(),20)) # _Chai Wah Wu_, May 10 2022

%Y Cf. A353709, A353710.

%K nonn,base

%O 1,4

%A _N. J. A. Sloane_, May 09 2022

%E More terms from _Rémy Sigrist_, May 09 2022