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.

Showing 1-3 of 3 results.

A020985 The Rudin-Shapiro or Golay-Rudin-Shapiro sequence (coefficients of the Shapiro polynomials).

Original entry on oeis.org

1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1
Offset: 0

Views

Author

Keywords

Comments

Other names are the Rudin-Shapiro or Golay-Rudin-Shapiro infinite word.
The Shapiro polynomials are defined by P_0 = Q_0 = 1; for n>=0, P_{n+1} = P_n + x^(2^n)*Q_n, Q_{n+1} = P_n - x^(2^n)*Q_n. Then P_n = Sum_{m=0..2^n-1} a(m)*x^m, where the a(m) (the present sequence) do not depend on n. - N. J. A. Sloane, Aug 12 2016
Related to paper-folding sequences - see the Mendès France and Tenenbaum article.
a(A022155(n)) = -1; a(A203463(n)) = 1. - Reinhard Zumkeller, Jan 02 2012
a(n) = 1 if and only if the numbers of 1's and runs of 1's in binary representation of n have the same parity: A010060(n) = A268411(n); otherwise, when A010060(n) = 1 - A268411(n), a(n) = -1. - Vladimir Shevelev, Feb 10 2016. Typo corrected and comment edited by Antti Karttunen, Jul 11 2017
A word that is uniform primitive morphic, but not pure morphic. - N. J. A. Sloane, Jul 14 2018
Named after the Austrian-American mathematician Walter Rudin (1921-2010), the mathematician Harold S. Shapiro (1928-2021) and the Swiss mathematician and physicist Marcel Jules Edouard Golay (1902-1989). - Amiram Eldar, Jun 13 2021

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 78 and many other pages.

Crossrefs

Cf. A022155, A005943 (factor complexity), A014081.
Cf. A020987 (0-1 version), A020986 (partial sums), A203531 (run lengths), A033999, A380667 (first differences).
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.

Programs

  • Haskell
    a020985 n = a020985_list !! n
    a020985_list = 1 : 1 : f (tail a020985_list) (-1) where
       f (x:xs) w = x : x*w : f xs (0 - w)
    -- Reinhard Zumkeller, Jan 02 2012
    
  • Maple
    A020985 := proc(n) option remember; if n = 0 then 1 elif n mod 2 = 0 then A020985(n/2) else (-1)^((n-1)/2 )*A020985( (n-1)/2 ); fi; end;
  • Mathematica
    a[0] = 1; a[1] = 1; a[n_?EvenQ] := a[n] = a[n/2]; a[n_?OddQ] := a[n] = (-1)^((n-1)/2)* a[(n-1)/2]; a /@ Range[0, 80] (* Jean-François Alcover, Jul 05 2011 *)
    a[n_] := 1 - 2 Mod[Length[FixedPointList[BitAnd[#, # - 1] &, BitAnd[n, Quotient[n, 2]]]], 2] (* Jan Mangaldan, Jul 23 2015 *)
    Array[RudinShapiro, 81, 0] (* JungHwan Min, Dec 22 2016 *)
  • PARI
    A020985(n)=(-1)^A014081(n)  \\ M. F. Hasler, Jun 06 2012
    
  • Python
    def a014081(n): return sum([((n>>i)&3==3) for i in range(len(bin(n)[2:]) - 1)])
    def a(n): return (-1)**a014081(n) # Indranil Ghosh, Jun 03 2017
    
  • Python
    def A020985(n): return -1 if (n&(n>>1)).bit_count()&1 else 1 # Chai Wah Wu, Feb 11 2023

Formula

a(0) = a(1) = 1; thereafter, a(2n) = a(n), a(2n+1) = a(n) * (-1)^n. [Brillhart and Carlitz, in proof of theorem 4]
a(0) = a(1) = 1, a(2n) = a(n), a(2n+1) = a(n)*(1-2*(n AND 1)), where AND is the bitwise AND operator. - Alex Ratushnyak, May 13 2012
Brillhart and Morton (1978) list many properties.
a(n) = (-1)^A014081(n) = (-1)^A020987(n) = 1-2*A020987(n). - M. F. Hasler, Jun 06 2012
Sum_{n >= 1} a(n-1)*(8*n^2+4*n+1)/(2*n*(2*n+1)*(4*n+1)) = 1; see Allouche and Sondow, 2015. - Jean-Paul Allouche and Jonathan Sondow, Mar 21 2015

A020987 Zero-one version of Golay-Rudin-Shapiro sequence (or word).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0
Offset: 0

Views

Author

Keywords

Comments

This is (1-A020985(n))/2. See A020985, which is the main entry for this sequence, for more information. N. J. A. Sloane, Jun 06 2012
A word that is uniform primitive morphic, but not pure morphic. - N. J. A. Sloane, Jul 14 2018

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 78.
  • Dekking, Michel, Michel Mendes France, and Alf van der Poorten. "Folds." The Mathematical Intelligencer, 4.3 (1982): 130-138 & front cover, and 4:4 (1982): 173-181 (printed in two parts).
  • G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
  • Lipshitz, Leonard, and A. van der Poorten. "Rational functions, diagonals, automata and arithmetic." In Number Theory, Richard A. Mollin, ed., Walter de Gruyter, Berlin (1990): 339-358.

Crossrefs

Cf. A020985.
A014081(n) mod 2. Characteristic function of A022155.
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.

Programs

A203463 Where Golay-Rudin-Shapiro sequence A020985 is positive.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 9, 10, 14, 16, 17, 18, 20, 21, 23, 27, 28, 29, 31, 32, 33, 34, 36, 37, 39, 40, 41, 42, 46, 51, 54, 56, 57, 58, 62, 64, 65, 66, 68, 69, 71, 72, 73, 74, 78, 80, 81, 82, 84, 85, 87, 91, 92, 93, 95, 99, 102, 107, 108, 109, 111, 112, 113, 114
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 02 2012

Keywords

Comments

A020985(a(n)) = 1.
Or numbers n for which numbers of 1's and runs of 1's in binary representation have the same parity: A010060(n)=A268411(n). - Vladimir Shevelev, Feb 10 2016

Crossrefs

Cf. A022155 (complement), A020985.

Programs

  • Haskell
    import Data.List (elemIndices)
    a203463 n = a203463_list !! (n-1)
    a203463_list = elemIndices 1 a020985_list
    
  • Mathematica
    GRS = Table[RudinShapiro[n], {n, 0, 200}];
    Position[GRS, ?Positive] - 1 // Flatten (* _Jean-François Alcover, Dec 11 2018 *)
  • Python
    from itertools import count, islice
    def A203463_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:(n&(n>>1)).bit_count()&1^1,count(max(startvalue,0)))
    A203463_list = list(islice(A203463_gen(),30)) # Chai Wah Wu, Feb 11 2023
Showing 1-3 of 3 results.