A122983 a(n) = (2 + (-1)^n + 3^n)/4.
1, 1, 3, 7, 21, 61, 183, 547, 1641, 4921, 14763, 44287, 132861, 398581, 1195743, 3587227, 10761681, 32285041, 96855123, 290565367, 871696101, 2615088301, 7845264903, 23535794707, 70607384121, 211822152361, 635466457083
Offset: 0
Links
- M. F. Hasler, Table of n, a(n) for n = 0..199.
- Ji Young Choi, A Generalization of Collatz Functions and Jacobsthal Numbers, J. Int. Seq., Vol. 21 (2018), Article 18.5.4.
- Alexander Diaz-Lopez, Pamela E. Harris, Erik Insko, and Darleen Perez-Lavin, Peaks Sets of Classical Coxeter Groups, arXiv preprint, arXiv:1505.04479 [math.GR], 2015.
- A. M. Hinz, S. Klavžar, U. Milutinović, and C. Petr, The Tower of Hanoi - Myths and Maths, Birkhäuser 2013. See page 99. Book's website
- Uri Levy, The Magnetic Tower of Hanoi, arXiv:1003.0225 [math.CO], 2010.
- Eric Weisstein's World of Mathematics, Domination Number.
- Eric Weisstein's World of Mathematics, Hanoi Graph.
- Eric Weisstein's World of Mathematics, Lower Independence Number.
- Eric Weisstein's World of Mathematics, Matching Number.
- Eric Weisstein's World of Mathematics, Sierpiński Gasket Graph.
- Index entries for linear recurrences with constant coefficients, signature (3,1,-3).
Crossrefs
Programs
-
Maple
A122983 := n -> ceil(3^n/4); 'A122983(n)' $ n=0..22; # M. F. Hasler, Feb 25 2008 a[ -1]:=1:a[0]:=1:a[1]:=3:for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]-2 od: seq(a[n], n=-1..25); # Zerinvary Lajos, Apr 28 2008
-
Mathematica
CoefficientList[Series[(1 - 2 x - x^2)/((1 - x) (1 + x) (1 - 3 x)), {x, 0, 40}], x] (* Harvey P. Dale, Sep 03 2013 *) LinearRecurrence[{3, 1, -3}, {1, 1, 3}, 40] (* Harvey P. Dale, Sep 03 2013 *) Table[(2 + (-1)^n + 3^n)/4, {n, 0, 20}] (* Eric W. Weisstein, Jun 16 2017 *) Table[Floor[3^n/4] + 1, {n, 0, 20}] (* Eric W. Weisstein, Jan 17 2018 *) Floor[3^Range[0, 20]/4] + 1 (* Eric W. Weisstein, Jan 17 2018 *)
-
PARI
A122983(n)=3^n\4+1 \\ M. F. Hasler, Feb 25 2008
-
Python
def A122983(n): return (1 if n&1 else 3)+3**n>>2 # Chai Wah Wu, Apr 12 2023
Formula
From Paul Barry, Jun 14 2007: (Start)
G.f.: (1-2*x-x^2)/((1-x)*(1+x)*(1-3*x));
a(n) = 3^n/4+(-1)^n/4+1/2;
E.g.f.: cosh(x)^2*exp(x). (End)
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3); a(0)=1, a(1)=1, a(2)=3. - Harvey P. Dale, Sep 03 2013
E.g.f.: Q(0)/2, where Q(k) = 1 + 3^k/( 2 - 2*(-1)^k/( 3^k + (-1)^k - 2*x*3^k/( 2*x + (k+1)*(-1)^k/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Dec 22 2013
a(2*n) = 3*a(2*n-1); a(2*n+1) = 3*a(2*n) - 2. - Philippe Deléham, Aug 23 2020
Extensions
Extended and corrected (existing Maple code) by M. F. Hasler, Feb 25 2008
Description changed to formula by Eric W. Weisstein, Jun 16 2017
Comments