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.

A203531 Run lengths in Golay-Rudin-Shapiro sequence A020985.

This page as a plain text file.
%I A203531 #21 Feb 16 2025 08:33:16
%S A203531 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,
%T A203531 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,
%U A203531 4,3,1,1,3,1,2,1,1,3,3,1,4,1,2,1,4,3
%N A203531 Run lengths in Golay-Rudin-Shapiro sequence A020985.
%C A203531 a(2*n) = length of n-th run of 1s; a(2*n+1) = length of n-th run of -1s.
%H A203531 Reinhard Zumkeller, <a href="/A203531/b203531.txt">Table of n, a(n) for n = 0..10000</a>
%H A203531 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Rudin-ShapiroSequence.html">Rudin-Shapiro Sequence</a>
%t A203531 Map[Length, Most[Split[RudinShapiro[Range[0, 200]]]]] (* _Paolo Xausa_, Jan 29 2025 *)
%o A203531 (Haskell)
%o A203531 import Data.List (group)
%o A203531 a203531 n = a203531_list !! n
%o A203531 a203531_list = map length $ group a020985_list
%o A203531 (Python)
%o A203531 from itertools import count, islice
%o A203531 def A203531_gen(): # generator of terms
%o A203531     c, a = 0, 1
%o A203531     for n in count(0):
%o A203531         if (n&(n>>1)).bit_count()&1^a:
%o A203531             c += 1
%o A203531         else:
%o A203531             yield c
%o A203531             c = 1
%o A203531             a ^= 1
%o A203531 A293531_list = list(islice(A203531_gen(),30)) # _Chai Wah Wu_, Feb 11 2023
%Y A203531 Cf. A020985.
%K A203531 nonn
%O A203531 0,1
%A A203531 _Reinhard Zumkeller_, Jan 02 2012