login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A341582 Number of simple moves of the smallest disk in the solution to the Towers of Hanoi exchanging disks puzzle with 3 pegs and n disks. 2
0, 1, 2, 4, 6, 12, 22, 42, 76, 142, 262, 488, 902, 1674, 3100, 5750, 10654, 19752, 36606, 67858, 125772, 233134, 432118, 800968, 1484630, 2751866, 5100732, 9454534, 17524526, 32482792, 60208782, 111600642, 206858476, 383424702, 710700742, 1317326728, 2441744422 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Scorer, Grundy and Smith define a variation of the towers of Hanoi puzzle where the smallest disk moves freely and two disks can exchange positions when they differ in size by 1, are on different pegs, and each is top-most on its peg.  The puzzle is to move a stack of n disks from one peg to another.

Stockmeyer et al. show the shortest solution to the puzzle is f(n) = A341579(n) steps.  They offer as an exercise for the reader to prove that the number of exchanges made within the solution is f(n-1) and the remaining a(n) = f(n) - f(n-1) here is the number of simple moves of the smallest disk (move-only, not exchange).

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.  See section 5 exercise 2.

Index entries for linear recurrences with constant coefficients, signature (1,1,0,2).

Index entries for sequences related to Towers of Hanoi

FORMULA

a(n) = A341579(n) - A341579(n-1), for n>=1. [Stockmeyer et al.]

a(n) = a(n-1) + a(n-2) + 2*a(n-4).

G.f.: x*(1 + x + x^2)/(1 - x - x^2 - 2*x^4)

EXAMPLE

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

              B---*             solution

             /     \            A to H,

            C       *           within

           / \     / \          which

          *---D---*---*         a(3) = 4

             /     \            smallest

        *   /       \   *       disk moves:

       / \ /         \ / \       AB, CD,

      F---E           *---*      EF, GH

     /     \         /     \

    G       I-------*       *

   / \     / \     / \     / \

  H---*---*---J   *---*---*---*

For n=4, the first half of the solution is A to J per A341580.  The smallest disk moves are AB, CD, IJ, and twice those is a(4) = 2*3 = 6 since J across to the next subgraph is an exchange, not a smallest disk move.

PROG

(PARI) my(p=Mod('x, 'x^4-'x^3-'x^2-2)); a(n) = subst(lift(p^n)\'x, 'x, 2);

CROSSREFS

Cf. A341579, A341580.

Sequence in context: A057575 A196700 A283834 * A326114 A135231 A326489

Adjacent sequences:  A341579 A341580 A341581 * A341583 A341584 A341585

KEYWORD

nonn,easy

AUTHOR

Kevin Ryde, Feb 16 2021

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 13 05:17 EDT 2021. Contains 344981 sequences. (Running on oeis4.)