A341581 Number of steps needed to move the largest disk out from a stack of n disks in the Towers of Hanoi exchanging disks puzzle with 3 pegs.
0, 1, 2, 5, 10, 20, 37, 70, 130, 243, 450, 836, 1549, 2874, 5326, 9875, 18302, 33928, 62885, 116566, 216058, 400483, 742314, 1375932, 2550365, 4727266, 8762262, 16241395, 30104390, 55800320, 103429237, 191712350, 355350370, 658663363, 1220872210, 2262960276
Offset: 0
Examples
As a graph where each vertex is a configuration of disks on pegs and each edge is a step (as drawn by Scorer et al.), A / \ *---* n=3 disks / \ A to D * * steps / \ / \ a(3) = 5 *---B---*---* / \ D / \ * / \ / \ / \ *---C *---* / \ / \ * *-------* * / \ / \ / \ / \ *---*---*---* *---*---*---* The recurrence using A341579 and A341580 is steps A341580(2)=3 from A to B, +1 from B to C, and A341579(1) = 1 from C to D (the whole puzzle solution in an n-2 subgraph).
Links
- Kevin Ryde, Table of n, a(n) for n = 0..700
- Paul K. Stockmeyer et al., Exchanging Disks in the Tower of Hanoi, International Journal of Computer Mathematics, volume 59, number 1-2, pages 37-47, 1995. Also author's copy. a(n) = h(n) in section 3.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-1,2,-2).
- Index entries for sequences related to Towers of Hanoi
Programs
-
PARI
my(p=Mod('x,'x^4-'x^3-'x^2-2)); a(n) = subst(lift(p^(n+2))\'x,'x,2)/2 - 1;
Comments