OFFSET
0,2
COMMENTS
A transform of 3^n under the matrix A103452.
a(n) is the number of moves required to solve a Towers of Hanoi puzzle of 3 towers in a line (no direct connection between the two towers on the ends) with n pieces to be moved from one end tower to the other. This is easily proved through demonstration. - Roderick Kimball, Nov 22 2015
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..190
Steven Schlicker, Roman Vasquez, and Rachel Wofford, Integer Sequences from Configurations in the Hausdorff Metric Geometry via Edge Covers of Bipartite Graphs, J. Int. Seq. (2023) Vol. 26, Art. 23.6.6.
Index entries for linear recurrences with constant coefficients, signature (4,-3).
FORMULA
G.f.: (1 -2*x +3*x^2)/((1-x)*(1-3*x)).
a(n) = Sum_{k=0..n} A103452(n, k)*3^k.
a(n) = Sum_{k=0..n} (2*0^(n-k) - 1)*0^(k*(n-k))*3^k.
From G. C. Greubel, Jun 18 2021: (Start)
E.g.f.: 1 - exp(x) + exp(3*x).
a(n) = [n=0] + 2*A003462(n). (End)
MATHEMATICA
Table[If[n==0, 1, 3^n -1], {n, 0, 30}] (* G. C. Greubel, Jun 18 2021 *)
LinearRecurrence[{4, -3}, {1, 2, 8}, 30] (* Harvey P. Dale, Feb 13 2022 *)
PROG
(Magma) [0^n+3^n-1: n in [0..30] ]; // Vincenzo Librandi, Apr 30 2011
(PARI) a(n) = if(n==0, 1, 3^n-1); \\ Altug Alkan, Nov 22 2015
(Sage) [3^n -1 +0^n for n in (0..30)] # G. C. Greubel, Jun 18 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Feb 06 2005
STATUS
approved