login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A203531 Run lengths in Golay-Rudin-Shapiro sequence A020985. 2
3, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1, 4, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
a(2*n) = length of n-th run of 1s; a(2*n+1) = length of n-th run of -1s.
LINKS
Eric Weisstein's World of Mathematics, Rudin-Shapiro Sequence
PROG
(Haskell)
import Data.List (group)
a203531 n = a203531_list !! n
a203531_list = map length $ group a020985_list
(Python)
from itertools import count, islice
def A203531_gen(): # generator of terms
c, a = 0, 1
for n in count(0):
if (n&(n>>1)).bit_count()&1^a:
c += 1
else:
yield c
c = 1
a ^= 1
A293531_list = list(islice(A203531_gen(), 30)) # Chai Wah Wu, Feb 11 2023
CROSSREFS
Cf. A020985.
Sequence in context: A257915 A257904 A257980 * A324885 A046645 A284639
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 02 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 4 21:18 EDT 2024. Contains 372257 sequences. (Running on oeis4.)