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

A052919 a(n) = 1 + 2*3^(n-1) with a(0)=2.

Original entry on oeis.org

2, 3, 7, 19, 55, 163, 487, 1459, 4375, 13123, 39367, 118099, 354295, 1062883, 3188647, 9565939, 28697815, 86093443, 258280327, 774840979, 2324522935, 6973568803, 20920706407, 62762119219, 188286357655, 564859072963
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

It appears that if s(n) is a first order rational sequence of the form s(1)=3, s(n) = (2*s(n-1)+1)/(s(n-1)+2), n > 1, then s(n) = a(n)/(a(n)-2).
The binomial transform is 2, 5, 15, 51, 187, ...A007581 without the leading term. - R. J. Mathar, Apr 07 2022

Programs

  • GAP
    Concatenation([2], List([1..30], n-> 1 + 2*3^(n-1) )); # G. C. Greubel, Oct 16 2019
  • Magma
    I:=[2, 3, 7]; [n le 3 select I[n] else 4*Self(n-1)-3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
    
  • Maple
    spec := [S,{S=Union(Sequence(Prod(Sequence(Z),Union(Z,Z))),Sequence(Z))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
    seq(`if`(n=0, 2, 1 + 2*3^(n-1)), n=0..30); # G. C. Greubel, Oct 16 2019
  • Mathematica
    Join[{2},Table[2*(3^n+1)-1,{n,0,30}]] (* Vladimir Joseph Stephan Orlovsky, Feb 14 2011*)
    CoefficientList[Series[(2-5*x+x^2)/((1-x)*(1-3*x)),{x,0,40}],x] (* Vincenzo Librandi, Jun 22 2012 *)
    LinearRecurrence[{4,-3},{2,3,7},30] (* Harvey P. Dale, Dec 12 2017 *)
  • PARI
    vector(31, n, if(n==1, 2, 1+ 2*3^(n-2))) \\ G. C. Greubel, Oct 16 2019
    
  • Sage
    [2]+[1+2*3^(n-1) for n in (1..30)] # G. C. Greubel, Oct 16 2019
    

Formula

a(n) = 1 + 2*3^(n-1) for n > 0 with a(0) = 2.
G.f.: (2 - 5*x + x^2)/((1-x)*(1-3*x)).
a(n) = 4*a(n-1) - 3*a(n-2), with a(0)=2, a(1)=3, a(2)=7.
a(0) = 2 and a(n) = A100702(n) for n >= 1. - Omar E. Pol, Mar 02 2012
a(n) = A104743(n) - A104743(n-1). - J. M. Bergot, Jun 07 2013

Extensions

More terms from James Sellers, Jun 05 2000

A183120 Magnetic Tower of Hanoi, number of moves of disk number k, generated by a certain algorithm, yielding a "forward moving" non-optimal solution of the [RED ; NEUTRAL ; NEUTRAL] or [NEUTRAL ; NEUTRAL ; BLUE] pre-colored puzzle.

Original entry on oeis.org

0, 1, 3, 7, 19, 55, 159, 471, 1403, 4199, 12583, 37735, 113187, 339543, 1018607, 3055799, 9167371, 27502087, 82506231, 247518663, 742555955, 2227667831, 6683003455, 20049010327, 60147030939, 180441092775, 541323278279, 1623969834791, 4871909504323
Offset: 0

Views

Author

Uri Levy, Jan 05 2011

Keywords

Comments

The Magnetic Tower of Hanoi puzzle is described in link 1 listed below. The Magnetic Tower is pre-colored. Pre-coloring is [RED ; NEUTRAL ; NEUTRAL] or [NEUTRAL ; NEUTRAL ; BLUE], given in [Source ; Intermediate ; Destination] order. The solution algorithm producing the presented sequence is NOT optimal. The particular "64" algorithm solving the puzzle at hand is not explicitly presented in any of the referenced papers. The series and its properties are listed in the paper referenced by link 2 listed below. For the optimal solution of the Magnetic Tower of Hanoi puzzle with the given pre-coloring configuration see A183115 and A183116. Optimal solutions are discussed and their optimality is proved in link 2 listed below.
Disk numbering is from largest disk (k = 1) to smallest disk (k = N)
The above-listed "original" sequence generates a "partial-sums" sequence - describing the total number of moves required to solve the puzzle.
Number of moves of disk k, for large k, is close to (23/36)*3^(k-1) ~ 0.64*3^(k-1). Series designation: P64(k).

References

  • Uri Levy, The Magnetic Tower of Hanoi, Journal of Recreational Mathematics, Volume 35 Number 3 (2006), 2010, pp 173.

Crossrefs

Cf. A100702 - is a sequence also describing the number of moves of disk number k, generated by another algorithm, designated "67", yielding a "forward moving" non-optimal solution of the [RED ; NEUTRAL ; NEUTRAL] or [NEUTRAL ; NEUTRAL ; BLUE] pre-colored puzzle at hand. Recurrence relations for this sequence is a(k) = 3*a(k-1) - 2 and the closed-form expression is (2/3)*3^(k-1)+1. Large k limit is clearly (2/3)*3^(k-1) =~ 0.67*3^(k-1), and sequence designation is thus P67(k). The (non-optimal) "67" algorithm solving the Magnetic Tower of Hanoi with the given pre-coloring configuration yielding the P67(k) sequence (given by A100702) is explicitly described and discussed in the paper referenced in link 1 above.
Cf. A000244 - "Powers of 3" is the sequence (also) describing the number of moves of the k-th disk solving [RED ; BLUE ; BLUE] or [RED ; RED ; BLUE] pre-colored Magnetic Tower of Hanoi puzzle.

Programs

  • Mathematica
    nxt[{a_,b_}]:=Module[{c=3b-2(a+1)},{a+1,If[EvenQ[a+1],c+6,c+8]}]; Join[ {0,1,3,7},Transpose[NestList[nxt,{4,19},25]][[2]]] (* or *) Join[ {0,1,3},LinearRecurrence[{4,-2,-4,3},{7,19,55,159},40]] (* Harvey P. Dale, May 04 2012 *)

Formula

G.f.: x*(3*x^2-x^3-2*x^4+4*x^5-1+x) / ((1+x)*(3*x-1)*(x-1)^2), equivalent to a(n) = 23*3^n/108+n-2-(-1)^n/4 for n>2.
(a(n) = P64(n) as in referenced paper):
a(n) = 3*a(n-1) - 2*n + 6; n even; n >= 4
a(n) = 3*a(n-1) - 2*n + 8; n odd; n >= 5
a(n) = a(n-1) + 2* P75(n-3) + 10*3^(n-4); n >= 4
P75(n) refers to the integer sequence described by A122983. See also A183119.
a(n) = (23/36)*3^(n-1) + n - 9/4; n even; n >= 4
a(n) = (23/36)*3^(n-1) + n - 7/4; n odd; n >= 3
a(n) = 4*a(n-1)- 2*a(n-2)-4*a(n-3)+3*a(n-4). [Harvey P. Dale, May 04 2012]

Extensions

More terms from Harvey P. Dale, May 04 2012

A183122 Magnetic Tower of Hanoi, number of moves of disk number k, generated by a certain algorithm, yielding a "forward moving" non-optimal solution of the [NEUTRAL ; NEUTRAL ; NEUTRAL] pre-colored puzzle.

Original entry on oeis.org

0, 1, 3, 7, 19, 53, 153, 455, 1359, 4073, 12213, 36635, 109899, 329693, 989073, 2967215, 8901639, 26704913, 80114733, 240344195, 721032579, 2163097733, 6489293193, 19467879575, 58403638719, 175210916153, 525632748453, 1576898245355, 4730694736059
Offset: 0

Views

Author

Uri Levy, Jan 07 2011

Keywords

Comments

A. The Magnetic Tower of Hanoi puzzle is described in link 1 listed below. The Magnetic Tower is pre-colored. Pre-coloring is [NEUTRAL ; NEUTRAL ; NEUTRAL], given in [Source ; Intermediate ; Destination] order. The solution algorithm producing the presented sequence is NOT optimal. The particular "62" algorithm solving the puzzle at hand is presented and discussed in the paper referenced by link 1 below. For the optimal solution of the Magnetic Tower of Hanoi puzzle with the given pre-coloring configuration (the "natural" or "free" Magnetic Tower) see A183117 and A183118. Optimal solutions are discussed and their optimality is proved in link 2 listed below.
B. Disk numbering is from largest disk (k = 1) to smallest disk (k = N)
C. The above-listed "original" sequence generates a "partial-sums" sequence - describing the total number of moves required to solve the puzzle.
D. Number of moves of disk k, for large k, is close to (67/108)*3^(k-1) ~ 0.62*3^(k-1). Series designation: P62(k).

References

  • U. Levy, The Magnetic Tower of Hanoi, Journal of Recreational Mathematics, Volume 35 Number 3 (2006), 2010, pp 173.

Crossrefs

A000244 "Powers of 3" is the sequence (also) describing the number of moves of the k-th disk solving [RED ; BLUE ; BLUE] or [RED ; RED ; BLUE] pre-colored Magnetic Tower of Hanoi puzzle. A183111 through A183125 are related sequences, all associated with various solutions of the pre-coloring variations of the Magnetic Tower of Hanoi.

Programs

  • Mathematica
    Join[{0,1,3,7},LinearRecurrence[{3,1,-3},{19,53,153},30]] (* Harvey P. Dale, Dec 08 2014 *)

Formula

a(n)=+3*a(n-1)+a(n-2)-3*a(n-3) for n>6.
g.f.: x+ 3*x^2 +7*x^3 -x^4*(-19+4*x+25*x^2)/ ((x-1)(3*x-1)(1+x)).
(a(n) = P62(n) as in referenced paper):
a(n) = 3*a(n-1) - 6; n even; n >= 6
a(n) = 3*a(n-1) - 4; n odd; n >= 5
a(n) = P67(n-1) + P67(n-2) + P75(n-3) + 8*3^(n-4) ; n >= 4
P75(n) and P67(n) refer to the integer sequences described by A122983 and A100702 respectively. See also A183119.
a(n) = (67/108)*3^(n-1) + 9/4; n even; n >= 4
a(n) = (67/108)*3^(n-1) + 11/4; n odd; n >= 5

Extensions

More terms from Harvey P. Dale, Dec 08 2014

A183061 First differences of A183060.

Original entry on oeis.org

0, 1, 3, 3, 7, 3, 7, 7, 19, 3, 7, 7, 19, 7, 19, 19, 55, 3, 7, 7, 19, 7, 19, 19, 55, 7, 19, 19, 55, 19, 55, 55, 163, 3, 7, 7, 19, 7, 19, 19, 55, 7, 19, 19, 55, 19, 55, 55, 163, 7, 19, 19, 55, 19, 55, 55, 163, 19, 55, 55, 163, 55, 163, 163, 487, 3
Offset: 0

Views

Author

Omar E. Pol, Feb 20 2011

Keywords

Comments

The sequence gives the number of cells turned "ON" at the n-th stage in the structure of A183060.

Examples

			If written as a triangle begins:
0,
1,
3,
3,7,
3,7,7,19,
3,7,7,19,7,19,19,55,
3,7,7,19,7,19,19,55,7,19,19,55,19,55,55,163,
It appears that row sums give A007582.
It appears that last terms of rows give A100702.
		

Crossrefs

Formula

a(n) = 1 + A147582(n)/2.
a(n) = 1 + 2*A147610(n).

A169723 3^(n-1)*(2*3^(n-1)+3)+1.

Original entry on oeis.org

6, 28, 190, 1540, 13366, 118828, 1065070, 9572500, 86113126, 774900028, 6973745950, 62762650660, 564860667286, 5083736439628, 45753599258830, 411782307236020, 3706040506843846, 33354363786753628, 300189271756259710, 2701703438832768580
Offset: 1

Views

Author

Alice V. Kleeva (alice27353(AT)gmail.com), Jan 19 2010

Keywords

Comments

A subsequence of the triangular numbers A000217.

Crossrefs

Programs

  • Magma
    I:=[6,28,190]; [n le 3 select I[n] else 13*Self(n-1)-39*Self(n-2)+27*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Dec 03 2012
  • Mathematica
    LinearRecurrence[{13, -39, 27}, {6, 28, 190}, 50]  (* or *) CoefficientList[Series[(-6 + 50 x - 60 x^2)/((x - 1) (3 x - 1) (9 x - 1)), {x, 0, 20}], x] (* Vincenzo Librandi, Dec 03 2012 *)

Formula

G.f.: x*(-6+50*x-60*x^2)/((x-1)*(3*x-1)*(9*x-1)). - Vincenzo Librandi, Dec 03 2012
a(n) = 13*a(n-1)-39*a(n-2)+27*a(n-3). - Vincenzo Librandi, Dec 03 2012
a(n) = 2*9^(n-1)+3^n+1. - Bruno Berselli, Dec 05 2012

A169724 (2*3^(n-1)+1)^2.

Original entry on oeis.org

9, 49, 361, 3025, 26569, 237169, 2128681, 19140625, 172213129, 1549760689, 13947373801, 125524947025, 1129720271689, 10167469690609, 91507188951721, 823564585774225, 7412080927594249, 66708727315226929, 600378542737678441, 5403406875341014225
Offset: 1

Views

Author

Alice V. Kleeva (alice27353(AT)gmail.com), Jan 19 2010

Keywords

Comments

A subsequence of the squares A000290.
Essentially equal to A052919(n)^2.

Crossrefs

Programs

  • Magma
    I:=[9, 49, 361]; [n le 3 select I[n] else 13*Self(n-1) - 39*Self(n-2) + 27*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Dec 03 2012
  • Mathematica
    CoefficientList[Series[(-9 + 68 x - 75 x^2)/((x - 1) (3 x - 1) (9 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 03 2012 *)
    LinearRecurrence[{13,-39,27},{9,49,361},20] (* Harvey P. Dale, Apr 23 2024 *)

Formula

a(n)= +13*a(n-1) -39*a(n-2) +27*a(n-3). G.f.: x*( -9+68*x-75*x^2 ) / ( (x-1)*(3*x-1)*(9*x-1) ). [R. J. Mathar, Apr 26 2010]

Extensions

G.f. adapted to the offset by Vincenzo Librandi, Dec 03 2012

A169725 a(n) = 3^(n-1)*(6*3^(n-1) + 5) + 1.

Original entry on oeis.org

12, 70, 532, 4510, 39772, 355510, 3192292, 28708750, 258313132, 2324621350, 20921001652, 188287243390, 1694579876092, 15251202941590, 137260778644612, 1235346864312430, 11118121348344652, 100063090843700230, 900567813719097172, 8105110311849259870
Offset: 1

Views

Author

Alice V. Kleeva (alice27353(AT)gmail.com), Jan 19 2010

Keywords

Crossrefs

Programs

  • Magma
    I:=[12, 70, 532]; [n le 3 select I[n] else 13*Self(n-1) -39*Self(n-2) +27*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Dec 03 2012
  • Maple
    A169725 := proc(n)
        3^(n-1)*(6*3^(n-1)+5)+1 ;
    end proc: # R. J. Mathar, Jun 02 2016
  • Mathematica
    Table[3^(n-1) (6 3^(n - 1) + 5) + 1, {n, 20}] (* or *) LinearRecurrence[{13, -39, 27}, {12, 70, 532}, 20] (* Harvey P. Dale, Aug 10 2011 *)
    CoefficientList[Series[(-12 + 86 x - 90 x^2)/((x - 1) (3 x - 1) (9 x - 1)), {x, 0, 30}], x] (* Vincenzo Librandi, Dec 03 2012 *)

Formula

From R. J. Mathar, Apr 26 2010: (Start)
a(n) = 13*a(n-1) - 39*a(n-2) + 27*a(n-3).
G.f.: x*( -12 + 86*x - 90*x^2 ) / ( (x-1)*(3*x-1)*(9*x-1) ). (End)
E.g.f.: (2*exp(9*x) + 5*exp(3*x) + 3*exp(x) - 10)/3. - Stefano Spezia, Dec 25 2021

Extensions

G.f. adapted to the offset by Vincenzo Librandi, Dec 03 2012

A381705 Length of iteration sequence of shortest unimodal Collatz (3x+1)/2 sequence that begins with exactly n increases and ends with continuous decreases until reaching 1.

Original entry on oeis.org

3, 6, 13, 32, 87, 250, 737, 2196, 6571, 19694, 59061, 177160, 531455, 1594338, 4782985, 14348924, 43046739, 129140182, 387420509, 1162261488, 3486784423, 10460353226, 31381059633, 94143178852, 282429536507, 847288609470, 2541865828357, 7625597485016, 22876792454991
Offset: 1

Views

Author

David Dewan, Mar 04 2025

Keywords

Comments

A unimodal Collatz sequence has one peak because it starts with only odd numbers (which increase) followed by only even numbers (which decrease). It uses the rule odd x -> (3x+1)/2.
A sequence of length a(n) starts with exactly n odd numbers and ends with 3^(n-1) even numbers and the final 1 for a total length of n + 3^(n-1) + 1.
The peak of a given sequence is 2^(3^(n-1)). See A023365.

Examples

			For n=2, the shortest unimodal sequence has length a(2) = 6 terms and one such sequence is
  3 -> 5 ->  8  -> 4 -> 2 -> 1
    \-----/     \----------/
  2 increases, then decreases
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{5,-7,3},{3,6,13},29] (* James C. McMahon, Apr 02 2025 *)

Formula

a(n) = n + 3^(n-1) + 1.
From Stefano Spezia, Mar 07 2025: (Start)
G.f.: x*(3 - 9*x + 4*x^2)/((1 - x)^2*(1 - 3*x)).
E.g.f.: (exp(3*x) + 3*exp(x)*(1 + x) - 4)/3. (End)
Showing 1-8 of 8 results.