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.

A020986 a(n) = n-th partial sum of Golay-Rudin-Shapiro sequence A020985.

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 3, 4, 5, 6, 7, 6, 5, 4, 5, 4, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 5, 6, 7, 8, 7, 8, 9, 10, 11, 10, 11, 12, 11, 12, 13, 14, 15, 14, 13, 12, 13, 12, 11, 10, 9, 10, 9, 8, 9, 8, 9, 10, 11, 10, 9, 8, 9, 8, 9, 10, 11, 10, 11, 12, 11, 12, 13, 14, 15, 14, 13, 12, 13, 12, 13, 14, 15, 14, 15, 16
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a020986 n = a020986_list !! n
    a020986_list = scanl1 (+) a020985_list
    -- Reinhard Zumkeller, Jan 02 2012
    
  • 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 *)
  • 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

Formula

Brillhart and Morton (1978) list many properties.

Extensions

Minor edits by N. J. A. Sloane, Jun 06 2012