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-4 of 4 results.

A360536 Analog of Rudin-Shapiro sum sequence A020990, based on counting patterns 00 instead of 11.

Original entry on oeis.org

1, 0, 1, 0, -1, -2, -1, -2, -1, 0, 1, 0, -1, -2, -1, -2, -3, -4, -5, -4, -5, -6, -5, -6, -5, -4, -3, -4, -5, -6, -5, -6, -5, -4, -3, -4, -3, -2, -3, -2, -1, 0, 1, 0, -1, -2, -1, -2, -3, -4, -5, -4, -5, -6, -5, -6, -5, -4, -3, -4, -5, -6, -5, -6, -7, -8, -9
Offset: 0

Views

Author

Jeffrey Shallit, Feb 10 2023

Keywords

Comments

a(n) = Sum_{i=0..n} (-1)^(i+e(i)), where e(i) counts the (possibly overlapping) occurrences of 00 in the base-2 representation of n. Note that e(0) = 0. This is the analog of A020990, which is the same sum, but with e(n) replaced by the function that counts the (possibly overlapping) occurrences of 11 in the base-2 representation of n.

Crossrefs

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

A334577 a(n) is the Y-coordinate of the n-th point of the space filling curve P defined in Comments section; sequence A334576 gives X-coordinates.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 06 2020

Keywords

Comments

The space filling curve P corresponds to the midpoint curve of the alternate paperfolding curve and can be built as follows:
- we define the family {P_k, k > 0}:
- P_1 corresponds to the points (0, 0), (1, 0), (2, 0) and (2, 1), in that order:
+
|
|
+----+----+
O
- for any k > 0, P_{n+1} is built from four copies of P_n as follows:
+
|A
+ |
C| +----+ |
A B| ---> |C B| |B C
+-------+ + | +----+-+
O C| | C|
A B| A| A B|
+-------+ +-+-------+
O
- the space filling curve P is the limit of P_k as k tends to infinity.
We can also describe the space filling curve P by mean of an L-system (see Links section).

Examples

			The first points of the space filling curve P are as follows:
      6|                                  20...21
       |                                  |    |
      5|                                  19   22
       |                                  |    |
      4|                        16...17...18   23
       |                        |              |
      3|                        15   26...25...24
       |                        |    |
      2|              4....5    14   27...28...29
       |              |    |    |              |
      1|              3    6    13...12...11   30
       |              |    |              |    |
      0|    0....1....2    7....8....9....10   31..
       |
    ---+----------------------------------------
    y/x|    0    1    2    3    4    5    6    7
- hence a(15) = a(24) = a(25) = a(26) = 3.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n+1) = (A020990(n) + A020990(n+1) - 1)/2 for any n >= 0.

A360535 Analog of Rudin-Shapiro sum sequence A020986, based on counting patterns 00 instead of 11.

Original entry on oeis.org

1, 2, 3, 4, 3, 4, 5, 6, 7, 6, 7, 8, 7, 8, 9, 10, 9, 10, 9, 8, 7, 8, 9, 10, 11, 10, 11, 12, 11, 12, 13, 14, 15, 14, 15, 16, 17, 16, 15, 14, 15, 14, 15, 16, 15, 16, 17, 18, 17, 18, 17, 16, 15, 16, 17, 18, 19, 18, 19, 20, 19, 20, 21, 22, 21, 22, 21, 20, 19, 20
Offset: 0

Views

Author

Jeffrey Shallit, Feb 10 2023

Keywords

Comments

a(n) = Sum_{i=0..n} (-1)^e(i), where e(i) counts the (possibly overlapping) occurrences of 00 in the base-2 representation of n. Note that e(0) = 0. This is the analog of A020986, which is the same sum, but with e(n) replaced by the function that counts the (possibly overlapping) occurrences of 11 in the base-2 representation of n.

Examples

			For n = 4, a(n) = 1+1+1+1+(-1) = 3.
		

Crossrefs

Showing 1-4 of 4 results.