login
a(n) = (4^(n+1) + 6n + 5)/9.
10

%I #56 Sep 18 2024 14:18:32

%S 1,3,9,31,117,459,1825,7287,29133,116515,466041,1864143,7456549,

%T 29826171,119304657,477218599,1908874365,7635497427,30541989673,

%U 122167958655,488671834581,1954687338283,7818749353089,31274997412311

%N a(n) = (4^(n+1) + 6n + 5)/9.

%C a(n) is the number of times a disk is moved from peg 1 to peg 2 during a move of a tower of 2n or (2n-1) disks from peg 1 to peg 2 ("Tower of Hanoi" problem). Binomial transform of A025579.

%C An approximation to A091841.

%H Vincenzo Librandi, <a href="/A073724/b073724.txt">Table of n, a(n) for n = 0..170</a>

%H Hacène Belbachir and El-Mehdi Mehiri, <a href="https://arxiv.org/abs/2210.08657">Enumerating moves in the optimal solution of the Tower of Hanoi</a>, arXiv:2210.08657 [math.CO], 2022.

%H F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, <a href="http://www.cs.uwaterloo.ca/journals/JIS/index.html">A Slow-Growing Sequence Defined by an Unusual Recurrence</a>, J. Integer Sequences, Vol. 10 (2007), #07.1.2.

%H F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, A Slow-Growing Sequence Defined by an Unusual Recurrence [<a href="http://neilsloane.com/doc/gijs.pdf">pdf</a>, <a href="http://neilsloane.com/doc/gijs.ps">ps</a>].

%H <a href="/index/Ge#Gijswijt">Index entries for sequences related to Gijswijt's sequence</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (6,-9,4).

%H <a href="/index/To#Hanoi">Index entries for sequences related to Towers of Hanoi</a>

%F G.f.: (1-3*x)/((1-4*x)*(1-x)^2).

%F a(n) = Sum_{k=0..n} A047849(k). - _L. Edson Jeffery_, May 01 2021

%F From _Elmo R. Oliveira_, Dec 11 2023: (Start)

%F a(n) = 6*a(n-1) - 9*a(n-2) + 4*a(n-3) for n>2.

%F E.g.f.: (1/9)*(4*(exp(4*x)) + 6*x*exp(x) + 5*exp(x)). (End)

%e Moving a tower of 4 disks = 2^4 - 1 moves, coded {1,0,5,1,2,3,1,0,5,4,2,5,1,0,5}. The move from peg 1 to peg 2 has code "0" and this occurs 3 times. For 3 disks we also find 3 zeros in {0,1,3,0,4,5,0}. Hence a(2)=3. The coding corresponds to the rank of the permutation {'from peg' 1, 'to peg' 2, 'by peg' 3} or {1,2,3} with rank 0.

%t Table[(4^(n+1)+6n+5)/9, {n, 0, 24}]

%o (PARI) a(n)=(4*4^n+6*n+5)/9

%o (PARI) a(n)=polcoeff((1-3*x)/(1-4*x)/(1-x)^2+x*O(x^n),n)

%o (Magma) [(4^(n+1)+6*n+5)/9: n in [0..40] ]; // _Vincenzo Librandi_, Apr 28 2011

%Y Cf. A001045, A002450, A007583, A020988, A025579, A047849 (first differences), A090822, A091841.

%K easy,nonn

%O 0,2

%A _Wouter Meeussen_, Sep 01 2002