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

A033120 Base-2 digits of a(n) are, in order, the first n terms of the periodic sequence with initial period 1,0,1.

Original entry on oeis.org

1, 2, 5, 11, 22, 45, 91, 182, 365, 731, 1462, 2925, 5851, 11702, 23405, 46811, 93622, 187245, 374491, 748982, 1497965, 2995931, 5991862, 11983725, 23967451, 47934902, 95869805, 191739611, 383479222, 766958445, 1533916891
Offset: 1

Views

Author

Keywords

Comments

Minimal number of moves required, under the proviso of a classical tower-of-Hanoi game, to segregate an initial n-disc peg into even and odd numbered discs pegs. - Lekraj Beedassy, Sep 12 2006

References

  • B. Averbach & O. Chein, "A Variant Of The Tower Of Brahma" in 'The Journal of Recreational Mathematics', pp. 48-55, vol. 33, no. 1, 2004-5, Baywood, NY.

Crossrefs

Cf. A023001, A033137 (similar in base 10).

Programs

  • Mathematica
    Table[FromDigits[PadRight[{},n,{1,0,1}],2],{n,40}] (* Harvey P. Dale, Aug 26 2016 *)
  • PARI
    a(n)=if(n%3==0,5*8^(n/3)-5,if(n%3==1,10*8^((n-1)/3)-3,20*8^((n-2)/3)-6))/7 \\ Ralf Stephan
    
  • PARI
    a(n)=(5*2^n)\7 \\ Tani Akinari, Jul 15 2014

Formula

From Ralf Stephan, May 05 2004: (Start)
a(3*n) = (5*8^n - 5)/7, a(3*n+1) = (10*8^n - 3)/7, a(3*n+2) = (20*8^n - 6)/7.
G.f.: (1+x^2)/((1-x)*(1-2*x)*(1+x+x^2)). (End)
a(n) = a(n-6) + 45*2^(n-6). - Lekraj Beedassy, Sep 12 2006
The following recurrence produces this sequence: if(n==1) a(n)=1; else if(n%3==2) a(n)=a(n-1)*2; otherwise a(n)=a(n-1)*2+1. - Piotr Kakol, Jan 24 2011 (in an email message to N. J. A. Sloane).
a(n) = floor( (5/7)*2^n ). - Tani Akinari, Jul 15 2014
From Jorijn Lamberink and Paul van de Veen, Oct 14 2019: (Start)
a(n) = T(n-1) + 1 + T(n-3) + 1 + a(n-3), where T(n) = A000225(n) = 2^n-1 is the number of moves for a classic Tower of Hanoi with n discs.
a(n) = (5/8)*2^n + a(n-3).
a(n) = (5/7)*2^n - 2/3 - (1/21)*cos((2/3)*Pi*n) + (1/7)*sqrt(3)*sin((2/3)*Pi*n). (End)

Extensions

More terms from Lekraj Beedassy, Sep 12 2006

A033131 Base-4 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0.

Original entry on oeis.org

1, 5, 20, 81, 325, 1300, 5201, 20805, 83220, 332881, 1331525, 5326100, 21304401, 85217605, 340870420, 1363481681, 5453926725, 21815706900, 87262827601, 349051310405, 1396205241620, 5584820966481, 22339283865925, 89357135463700
Offset: 1

Views

Author

Keywords

Examples

			The first six terms have base-4 representations 1, 11, 110, 1101, 11011, 110110.
		

Crossrefs

Cf. A033137 (similar in base 10).

Programs

  • Magma
    I:=[1, 5, 20, 81]; [n le 4 select I[n] else 4*Self(n-1)+Self(n-3)-4*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 21 2012
  • Mathematica
    LinearRecurrence[{4,0,1,-4},{1,4,17,69},30] (* Vincenzo Librandi, Jun 21 2012 *)
    With[{nn=30},Table[FromDigits[PadRight[{},n,{1,1,0}],4],{n,nn}]] (* Harvey P. Dale, Oct 22 2015 *)

Formula

a(n) = 4*a(n-1) + a(n-3) - 4*a(n-4).
G.f.: x*(x+1)/((x-1)*(4*x-1)*(1+x+x^2)). - Vincenzo Librandi, Jun 21 2012
a(n) = floor( (20/63)*4^n ). - Tani Akinari, Jul 16 2014

A033134 Base-7 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0.

Original entry on oeis.org

1, 8, 56, 393, 2752, 19264, 134849, 943944, 6607608, 46253257, 323772800, 2266409600, 15864867201, 111054070408, 777378492856, 5441649449993, 38091546149952, 266640823049664, 1866485761347649, 13065400329433544, 91457802306034808, 640204616142243657
Offset: 1

Views

Author

Keywords

Examples

			The first six terms have base-7 representations 1, 11, 110, 1101, 11011, 110110.
		

Crossrefs

Cf. A033137 (similar in base 10).

Programs

  • PARI
    Vec(x*(1+x)/((1-x)*(1-7*x)*(1+x+x^2)) + O(x^30)) \\ Colin Barker, Dec 24 2015

Formula

a(n) = 7*a(n-1) + a(n-3) - 7*a(n-4).
a(n) = floor( (28/171)*7^n ). - Tani Akinari, Jul 16 2014
G.f.: x*(1+x) / ((1-x)*(1-7*x)*(1+x+x^2)). - Colin Barker, Dec 24 2015

A033132 Base-5 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0.

Original entry on oeis.org

1, 6, 30, 151, 756, 3780, 18901, 94506, 472530, 2362651, 11813256, 59066280, 295331401, 1476657006, 7383285030, 36916425151, 184582125756, 922910628780, 4614553143901, 23072765719506, 115363828597530, 576819142987651
Offset: 1

Views

Author

Keywords

Examples

			The first six terms have base 5 representations 1, 11, 110, 1101, 11011, 110110.
		

Crossrefs

Cf. A033137 (similar in base 10).

Programs

  • Mathematica
    Table[FromDigits[PadRight[{},n,{1,1,0}],5],{n,30}] (* Harvey P. Dale, Sep 06 2015 *)
  • PARI
    Vec(x*(x+1)/((x-1)*(5*x-1)*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Jul 17 2014

Formula

a(n) = 5*a(n-1) + a(n-3) - 5*a(n-4).
a(n) = floor( (15/62)*5^n ). - Tani Akinari, Jul 16 2014
G.f.: x*(x+1) / ((x-1)*(5*x-1)*(x^2+x+1)). - Colin Barker, Jul 17 2014

A033136 Base 9 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0.

Original entry on oeis.org

1, 10, 90, 811, 7300, 65700, 591301, 5321710, 47895390, 431058511, 3879526600, 34915739400, 314241654601, 2828174891410, 25453574022690, 229082166204211, 2061739495837900, 18555655462541100, 167000899162869901, 1503008092465829110, 13527072832192461990
Offset: 1

Views

Author

Keywords

Examples

			The first six terms have base 9 representations 1, 11, 110, 1101, 11011, 110110.
		

Crossrefs

Cf. A033137 (similar in base 10).

Programs

  • Mathematica
    Module[{nn=30,c},c=PadRight[{},nn,{1,1,0}];Table[FromDigits[Take[c,n],9],{n,nn}]] (* Harvey P. Dale, Aug 18 2014 *)
  • PARI
    Vec(x*(1+x) / ( (x-1)*(9*x-1)*(1+x+x^2) ) + O(x^50)) \\ Michel Marcus, Jul 15 2014

Formula

G.f.: x*(1+x) / ( (x-1)*(9*x-1)*(1+x+x^2) ). a(n) = A033145(n) + A033145(n-1). - R. J. Mathar, Jan 08 2011
a(n) = round( (45/364)*9^n ). - Tani Akinari, Jul 15 2014
a(n+1) = 9*a(n) if n == 2 (mod 3), 9*a(n)+1 otherwise. - Robert Israel, Jul 15 2014

Extensions

More terms from Michel Marcus, Jul 15 2014
Showing 1-5 of 5 results.