[go: up one dir, main page]

login
A020990
a(n) = Sum_{k=0..n} (-1)^k*A020985(k).
5
1, 0, 1, 2, 3, 2, 1, 0, 1, 0, 1, 2, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 5, 4, 3, 4, 3, 2, 3, 2, 1, 0, 1, 0, 1, 2, 3, 2, 1, 0, 1, 0, 1, 2, 1, 2, 3, 4, 3, 4, 3, 2, 1, 2, 3, 4, 5, 4, 5, 6, 5, 6, 7, 8, 9, 8, 9, 10, 11, 10, 9, 8, 9, 8, 9, 10, 9, 10, 11
OFFSET
0,4
LINKS
John Brillhart and Patrick Morton, Über Summen von Rudin-Shapiroschen Koeffizienten, (German) Illinois J. Math. 22 (1978), no. 1, 126--148. MR0476686 (57 #16245). - 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.
Narad Rampersad and Jeffrey Shallit, Rudin-Shapiro Sums Via Automata Theory and Logic, arXiv:2302.00405 [math.NT], February 1 2023.
FORMULA
Brillhart and Morton (1978) list many properties.
MATHEMATICA
Accumulate[Table[(-1)^n*RudinShapiro[n], {n, 0, 100}]] (* Paolo Xausa, Oct 18 2024 *)
PROG
(Haskell)
a020990 n = a020990_list !! n
a020990_list = scanl1 (+) $ zipWith (*) a033999_list a020985_list
-- Reinhard Zumkeller, Jun 06 2012
(PARI) a(n) = sum(k=0, n, (-1)^(k+hammingweight(bitand(k, k>>1)))); \\ Michel Marcus, Oct 07 2017
(Python)
def A020990(n): return sum(-1 if ((m&(m>>1)).bit_count()^m)&1 else 1 for m in range(n+1)) # Chai Wah Wu, Feb 11 2023
CROSSREFS
Sequence in context: A165592 A059285 A165578 * A260686 A037891 A037899
KEYWORD
nonn
EXTENSIONS
Edited by N. J. A. Sloane, Jun 06 2012
STATUS
approved