OFFSET
0,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
John Brillhart and Patrick Morton, Über Summen von Rudin-Shapiroschen Koeffizienten, (German) Illinois J. Math. 22 (1978), no. 1, 126--148. MR0476686 (57 #16245). - From N. J. A. Sloane, Jun 06 2012
J. Brillhart and P. Morton, A case study in mathematical research: the Golay-Rudin-Shapiro sequence, Amer. Math. Monthly, 103 (1996) 854-869.
Philip Lafrance, Narad Rampersad, and Randy Yee, Some properties of a Rudin-Shapiro-like sequence, arXiv:1408.2277 [math.CO], 2014.
Narad Rampersad and Jeffrey Shallit, Rudin-Shapiro Sums Via Automata Theory and Logic, arXiv:2302.00405 [math.NT], February 1 2023.
Eric Weisstein's World of Mathematics, Rudin-Shapiro Sequence
FORMULA
Brillhart and Morton (1978) list many properties.
MATHEMATICA
a[n_] := 1 - 2 Mod[Length[FixedPointList[BitAnd[#, # - 1] &, BitAnd[n, Quotient[n, 2]]]], 2]; Accumulate@ Table[a@ n, {n, 0, 85}] (* Michael De Vlieger, Nov 30 2015, after Jan Mangaldan at A020985 *)
Table[RudinShapiro[n], {n, 0, 100}] // Accumulate (* Jean-François Alcover, Jun 30 2022 *)
PROG
(Haskell)
a020986 n = a020986_list !! n
a020986_list = scanl1 (+) a020985_list
-- Reinhard Zumkeller, Jan 02 2012
(Python)
def A020986(n): return sum(-1 if (m&(m>>1)).bit_count()&1 else 1 for m in range(n+1)) # Chai Wah Wu, Feb 11 2023
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Minor edits by N. J. A. Sloane, Jun 06 2012
STATUS
approved