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-10 of 13 results. Next

A020991 Largest value of k for which Golay-Rudin-Shapiro sequence A020986(k) = n.

Original entry on oeis.org

0, 3, 6, 15, 26, 27, 30, 63, 106, 107, 110, 111, 122, 123, 126, 255, 426, 427, 430, 431, 442, 443, 446, 447, 490, 491, 494, 495, 506, 507, 510, 1023, 1706, 1707, 1710, 1711, 1722, 1723, 1726, 1727, 1770, 1771, 1774, 1775, 1786, 1787, 1790, 1791, 1962, 1963
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

a(2^n) = 2^(2n) - 1. - Seiichi Manyama, Apr 23 2017

Extensions

More terms from Robert G. Wilson v; further extended by David W. Wilson, Jun 1997

A212591 a(n) is the smallest value of k for which A020986(k) = n.

Original entry on oeis.org

0, 1, 2, 5, 8, 9, 10, 21, 32, 33, 34, 37, 40, 41, 42, 85, 128, 129, 130, 133, 136, 137, 138, 149, 160, 161, 162, 165, 168, 169, 170, 341, 512, 513, 514, 517, 520, 521, 522, 533, 544, 545, 546, 549, 552, 553, 554, 597, 640, 641, 642, 645, 648, 649, 650, 661
Offset: 1

Views

Author

Michael Day, May 22 2012

Keywords

Comments

Brillhart and Morton derive an omega function for the largest values of k. This sequence appears to be given by a similar alpha function.

Crossrefs

Programs

  • J
    NB. J function on a vector
    NB. Beware round-off errors on large arguments
    NB. ok up to ~ 1e8
    alphav =: 3 : 0
    n   =. <: y
    if.+/ ntlo=. n > 0 do.
    n   =. ntlo#n
    m   =. >.-: n
    r   =. <.2^.m
    f   =. <.3%~2+2^2*>:i.>./>:r
    z   =. 0
    mi  =. m
    for_i. i.#f do.
      z   =. z + (i{f) * <.0.5 + mi =. mi%2
    end.
    nzer=. (+/ @: (0=>./\)@:|.)"1 @: #: m
    ntlo #^:_1 z - (2|n) * <.-:nzer{f
    else.
    ntlo
    end.
    )
    NB. eg    alphav 1 3 5 100 2 8 33
  • PARI
    alpha(n)={
    if(n<2, return(max(0,n-1)));
    local(nm1=n-1,
          mi=m=ceil(nm1/2),
          r=floor(log(m)/log(2)),
    i,fi,alpha=0,a);
    forstep(i=1, 2*r+1, 2,
        mi/=2;
        fi=(1+2^i)\3;
    alpha+=fi*floor(0.5+mi);
           );
    alpha*=2;
    if(nm1%2,   \\ adjust for even n
       a=factor(2*m)[1,2]-1;
    alpha-= (1+2^(1+2*a))\3;
      );
    return(alpha);
    }
    

Formula

a(2*n-1) - a(2*n-2) = (2^(2*k+1)+1)/3 and a(2*n) - a(2*n-1) = (2^(2*k+1)+1)/3 with a(0) = a(1) = 0, where n = (2^k)*(2*m-1) for some integers k >= 0 and m > 0.
Restating the formula above, a(n+1) - a(n) = A007583(A050605(n-1)) = A276391 with terms repeated. - John Keith, Mar 04 2021

Extensions

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

A093573 Triangle read by rows: row n gives positions where n occurs in the Golay-Rudin-Shapiro related sequence A020986.

Original entry on oeis.org

0, 1, 3, 2, 4, 6, 5, 7, 13, 15, 8, 12, 14, 16, 26, 9, 11, 17, 19, 25, 27, 10, 18, 20, 22, 24, 28, 30, 21, 23, 29, 31, 53, 55, 61, 63, 32, 50, 52, 54, 56, 60, 62, 64, 106, 33, 35, 49, 51, 57, 59, 65, 67, 105, 107, 34, 36, 38, 48, 58, 66, 68, 70, 104, 108, 110, 37, 39, 45, 47, 69, 71, 77, 79, 101, 103, 109, 111
Offset: 1

Views

Author

Eric W. Weisstein, Apr 01 2004

Keywords

Comments

Each positive integer n occurs n times, so the n-th row has length n.

Examples

			A020986(n) for n = 0, 1, ... is 1, 2, 3, 2, 3, 4, 3, 4, 5, 6, ..., so the positions of 1, 2, 3, 4, ... are 0; 1, 3; 2, 4, 6; 5, 7, 13, 15; ...
From _Seiichi Manyama_, Apr 23 2017: (Start)
Triangle begins:
   0,
   1,  3,
   2,  4,  6,
   5,  7, 13, 15,
   8, 12, 14, 16, 26,
   9, 11, 17, 19, 25, 27,
  10, 18, 20, 22, 24, 28, 30,
  21, 23, 29, 31, 53, 55, 61, 63,
  32, 50, 52, 54, 56, 60, 62, 64, 106,
  33, 35, 49, 51, 57, 59, 65, 67, 105, 107,
  34, 36, 38, 48, 58, 66, 68, 70, 104, 108, 110,
  ... (End)
		

Crossrefs

Column k=1 gives A212591. Diagonal k=n gives A020991.

Programs

  • Haskell
    a093573 n k = a093573_row n !! (k-1)
    a093573_row n = take n $ elemIndices n a020986_list
    a093573_tabl = map a093573_row [1..]
    -- Reinhard Zumkeller, Jun 06 2012
  • Mathematica
    With[{n = 16}, TakeWhile[#, Length@ #2 == #1 & @@ # &][[All, -1]] &@ Transpose@ {Keys@ #, Lookup[#, Keys@ #]} &[PositionIndex@ Accumulate@ Array[1 - 2 Mod[Length[FixedPointList[BitAnd[#, # - 1] &, BitAnd[#, Quotient[#, 2]]]], 2] &, n^2, 0] - 1]] // Flatten (* Michael De Vlieger, Jan 25 2020 *)

Extensions

Offset corrected by Reinhard Zumkeller, Jun 06 2012

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

A004171 a(n) = 2^(2n+1).

Original entry on oeis.org

2, 8, 32, 128, 512, 2048, 8192, 32768, 131072, 524288, 2097152, 8388608, 33554432, 134217728, 536870912, 2147483648, 8589934592, 34359738368, 137438953472, 549755813888, 2199023255552, 8796093022208, 35184372088832, 140737488355328, 562949953421312
Offset: 0

Views

Author

Keywords

Comments

Same as Pisot sequences E(2, 8), L(2, 8), P(2, 8), T(2, 8). See A008776 for definitions of Pisot sequences.
In the Chebyshev polynomial of degree 2n, a(n) is the coefficient of x^2n. - Benoit Cloitre, Mar 13 2002
1/2 - 1/8 + 1/32 - 1/128 + ... = 2/5. - Gary W. Adamson, Mar 03 2009
From Adi Dani, May 15 2011: (Start)
Number of ways of placing an even number of indistinguishable objects in n + 1 distinguishable boxes with at most 3 objects in box.
Number of compositions of even natural numbers into n + 1 parts less than or equal to 3 (0 is counted as part). (End)
Also the number of maximal cliques in the (n+1)-Sierpinski tetrahedron graph for n > 0. - Eric W. Weisstein, Dec 01 2017
Assuming the Collatz conjecture is true, any starting number eventually leads to a power of 2. A number in this sequence can never be the first power of 2 in a Collatz sequence except of course for the Collatz sequence starting with that number. For example, except for 8, 4, 2, 1, any Collatz sequence that includes 8 must also include 16 (e.g., 5, 16, 8, 4, 2, 1). - Alonso del Arte, Oct 01 2019
First differences of A020988, and thus the "wavelengths" of the local maxima in A020986. See the Brillhart and Morton link, pp. 855-856. - John Keith, Mar 04 2021

Examples

			G.f. = 2 + 8*x + 32*x^2 + 128*x^3 + 512*x^4 + 2048*x^5 + 8192*x^6 + 32768*x^7 + ...
From _Adi Dani_, May 15 2011: (Start)
a(1) = 8 because all compositions of even natural numbers into 2 parts less than or equal to 3 are:
  for 0: (0, 0)
  for 2: (0, 2), (2, 0), (1, 1)
  for 4: (1, 3), (3, 1), (2, 2)
  for 6: (3, 3).
a(2) = 32 because all compositions of even natural numbers into 3 parts less than or equal to 3 are:
  for 0: (0, 0, 0)
  for 2: (0, 0, 2), (0, 2, 0), (2, 0, 0), (0, 1, 1), (1, 0, 1) , (1, 1, 0)
  for 4: (0, 1, 3), (0, 3, 1), (1, 0, 3), (1, 3, 0), (3, 0, 1), (3, 1, 0), (0, 2, 2), (2, 0, 2), (2, 2, 0), (1, 1, 2), (1, 2, 1), (2, 1, 1)
  for 6: (0, 3, 3), (3, 0, 3), (3, 3, 0), (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1), (2, 2, 2)
  for 8: (2, 3, 3), (3, 2, 3), (3, 3, 2).
(End)
		

References

  • Adi Dani, Quasicompositions of natural numbers, Proceedings of III congress of mathematicians of Macedonia, Struga Macedonia 29 IX -2 X 2005 pages 225-238.

Crossrefs

Absolute value of A009117. Essentially the same as A081294.
Cf. A132020, A164632. Equals A000980(n) + 2*A181765(n). Cf. A013776.

Programs

Formula

a(n) = 2*4^n.
a(n) = 4*a(n-1).
1 = 1/2 + Sum_{n >= 1} 3/a(n) = 3/6 + 3/8 + 3/32 + 3/128 + 3/512 + 3/2048 + ...; with partial sums: 1/2, 31/32, 127/128, 511/512, 2047/2048, ... - Gary W. Adamson, Jun 16 2003
From Philippe Deléham, Nov 23 2008: (Start)
a(n) = 2*A000302(n).
G.f.: 2/(1-4*x). (End)
a(n) = A081294(n+1) = A028403(n+1) - A000079(n+1) for n >= 1. a(n-1) = A028403(n) - A000079(n). - Jaroslav Krizek, Jul 27 2009
E.g.f.: 2*exp(4*x). - Ilya Gutkovskiy, Nov 01 2016
a(n) = A002063(n)/3 - A000302(n). - Zhandos Mambetaliyev, Nov 19 2016
a(n) = Sum_{k = 0..2*n} (-1)^(k+n)*binomial(4*n + 2, 2*k + 1); a(2*n) = Sum_{k = 0..2*n} binomial(4*n + 2, 2*k + 1) = A013776(n). - Peter Bala, Nov 25 2016
Product_{n>=0} (1 - 1/a(n)) = A132020. - Amiram Eldar, May 08 2023

A020988 a(n) = (2/3)*(4^n-1).

Original entry on oeis.org

0, 2, 10, 42, 170, 682, 2730, 10922, 43690, 174762, 699050, 2796202, 11184810, 44739242, 178956970, 715827882, 2863311530, 11453246122, 45812984490, 183251937962, 733007751850, 2932031007402, 11728124029610, 46912496118442, 187649984473770, 750599937895082
Offset: 0

Views

Author

Keywords

Comments

Numbers whose binary representation is 10, n times (see A163662(n) for n >= 1). - Alexandre Wajnberg, May 31 2005
Numbers whose base-4 representation consists entirely of 2's; twice base-4 repunits. - Franklin T. Adams-Watters, Mar 29 2006
Expected time to finish a random Tower of Hanoi problem with 2n disks using optimal moves, so (since 2n is even and A010684(2n) = 1) a(n) = A060590(2n). - Henry Bottomley, Apr 05 2001
a(n) is the number of derangements of [2n + 3] with runs consisting of consecutive integers. E.g., a(1) = 10 because the derangements of {1, 2, 3, 4, 5} with runs consisting of consecutive integers are 5|1234, 45|123, 345|12, 2345|1, 5|4|123, 5|34|12, 45|23|1, 345|2|1, 5|4|23|1, 5|34|2|1 (the bars delimit the runs). - Emeric Deutsch, May 26 2003
For n > 0, also smallest numbers having in binary representation exactly n + 1 maximal groups of consecutive zeros: A087120(n) = a(n-1), see A087116. - Reinhard Zumkeller, Aug 14 2003
Number of walks of length 2n + 3 between any two diametrically opposite vertices of the cycle graph C_6. Example: a(0) = 2 because in the cycle ABCDEF we have two walks of length 3 between A and D: ABCD and AFED. - Emeric Deutsch, Apr 01 2004
From Paul Barry, May 18 2003: (Start)
Row sums of triangle using cumulative sums of odd-indexed rows of Pascal's triangle (start with zeros for completeness):
0 0
1 1
1 4 4 1
1 6 14 14 6 1
1 8 27 49 49 27 8 1 (End)
a(n) gives the position of the n-th zero in A173732, i.e., A173732(a(n)) = 0 for all n and this gives all the zeros in A173732. - Howard A. Landman, Mar 14 2010
Smallest number having alternating bit sum -n. Cf. A065359. For n = 0, 1, ..., the last digit of a(n) is 0, 2, 0, 2, ... . - Washington Bomfim, Jan 22 2011
Number of toothpicks minus 1 in the toothpick structure of A139250 after 2^n stages. - Omar E. Pol, Mar 15 2012
For n > 0 also partial sums of the odd powers of 2 (A004171). - K. G. Stier, Nov 04 2013
Values of m such that binomial(4*m + 2, m) is odd. Cf. A002450. - Peter Bala, Oct 06 2015
For a(n) > 2, values of m such that m is two steps away from a power of 2 under the Collatz iteration. - Roderick MacPhee, Nov 10 2016
a(n) is the position of the first occurrence of 2^(n+1)-1 in A020986. See the Brillhart and Morton link, pp. 856-857. - John Keith, Jan 12 2021
a(n) is the number of monotone paths in the n-dimensional cross-polytope for a generic linear orientation. See the Black and De Loera link. - Alexander E. Black, Feb 15 2023

Crossrefs

Programs

Formula

a(n) = 4*a(n-1) + 2, a(0) = 0.
a(n) = A026644(2*n).
a(n) = A007583(n) - 1 = A039301(n+1) - 2 = A083584(n-1) + 1.
E.g.f. : (2/3)*(exp(4*x)-exp(x)). - Paul Barry, May 18 2003
a(n) = A007583(n+1) - 1 = A039301(n+2) - 2 = A083584(n) + 1. - Ralf Stephan, Jun 14 2003
G.f.: 2*x/((1-x)*(1-4*x)). - R. J. Mathar, Sep 17 2008
a(n) = a(n-1) + 2^(2n-1), a(0) = 0. - Washington Bomfim, Jan 22 2011
a(n) = A193652(2*n). - Reinhard Zumkeller, Aug 08 2011
a(n) = 5*a(n-1) - 4*a(n-2) (n > 1), a(0) = 0, a(1) = 2. - L. Edson Jeffery, Mar 02 2012
a(n) = (2/3)*A024036(n). - Omar E. Pol, Mar 15 2012
a(n) = 2*A002450(n). - Yosu Yurramendi, Jan 24 2017
From Seiichi Manyama, Nov 24 2017: (Start)
Zeta_{GL(2)/F_1}(s) = Product_{k = 1..4} (s-k)^(-b(2,k)), where Sum b(2,k)*t^k = t*(t-1)*(t^2-1). That is Zeta_{GL(2)/F_1}(s) = (s-3)*(s-2)/((s-4)*(s-1)).
Zeta_{GL(2)/F_1}(s) = Product_{n > 0} (1 - (1/s)^n)^(-A295521(n)) = Product_{n > 0} (1 - x^n)^(-A295521(n)) = (1-3*x)*(1-2*x)/((1-4*x)*(1-x)) = 1 + Sum_{k > 0} a(k-1)*x^k (x=1/s). (End)
From Oboifeng Dira, May 29 2020: (Start)
a(n) = A078008(2n+1) (second bisection).
a(n) = Sum_{k=0..n} binomial(2n+1, ((n+2) mod 3)+3k). (End)
From John Reimer Morales, Aug 04 2025: (Start)
a(n) = A000302(n) - A047849(n).
a(n) = A020522(n) + A000079(n) - A047849(n). (End)

Extensions

Edited by N. J. A. Sloane, Sep 06 2006

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

A020990 a(n) = Sum_{k=0..n} (-1)^k*A020985(k).

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a020990 n = a020990_list !! n
    a020990_list = scanl1 (+) $ zipWith (*) a033999_list a020985_list
    -- Reinhard Zumkeller, Jun 06 2012
    
  • Mathematica
    Accumulate[Table[(-1)^n*RudinShapiro[n], {n, 0, 100}]] (* Paolo Xausa, Oct 18 2024 *)
  • 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

Formula

Brillhart and Morton (1978) list many properties.

Extensions

Edited by N. J. A. Sloane, Jun 06 2012

A051032 Summatory Rudin-Shapiro sequence for 2^(n-1).

Original entry on oeis.org

2, 3, 3, 5, 5, 9, 9, 17, 17, 33, 33, 65, 65, 129, 129, 257, 257, 513, 513, 1025, 1025, 2049, 2049, 4097, 4097, 8193, 8193, 16385, 16385, 32769, 32769, 65537, 65537, 131073, 131073, 262145, 262145, 524289, 524289, 1048577, 1048577, 2097153
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    d2n[n_]:=Module[{x=2^n+1},{x,x}];Join[{2},Flatten[Array[d2n,30]]] (* Harvey P. Dale, May 26 2011 *)

Formula

Apart from leading term, just A000051 (2^n + 1) doubled up.
G.f.: -x*(-2 - x + 4*x^2)/((x - 1)*(2*x^2 - 1)). - R. J. Mathar, Jul 15 2016
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3). - Wesley Ivan Hurt, Aug 19 2022
E.g.f.: cosh(x) + cosh(sqrt(2)*x) + sinh(x) + sinh(sqrt(2)*x)/sqrt(2) - 2. - Stefano Spezia, Feb 05 2023

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

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 6, 6, 5, 4, 4, 4, 4, 5, 6, 6, 6, 7, 7, 7, 7, 6, 5, 5, 6, 7, 7, 7, 8, 9, 10, 10, 10, 11, 11, 11, 12, 13, 14, 14, 13, 12, 12, 12, 11, 10, 9, 9, 9, 8, 8, 8, 8, 9, 10, 10, 9, 8, 8, 8, 8, 9, 10, 10, 10, 11, 11, 11, 12, 13, 14, 14, 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(9) = a(12) = a(17) = a(26) = a(27) = 5.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n+1) = (A020986(n) + A020986(n+1) - 1)/2 for any n >= 0.
Showing 1-10 of 13 results. Next