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
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 02 2012
STATUS
approved