This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A341579 #30 Jun 29 2023 09:53:52 %S A341579 0,1,3,7,13,25,47,89,165,307,569,1057,1959,3633,6733,12483,23137, %T A341579 42889,79495,147353,273125,506259,938377,1739345,3223975,5975841, %U A341579 11076573,20531107,38055633,70538425,130747207,242347849,449206325,832631027,1543331769,2860658497 %N A341579 Number of steps needed to solve the Towers of Hanoi exchanging disks puzzle with 3 pegs and n disks. %C A341579 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 topmost on its peg. The aim is to move a stack of n disks from one peg to another. %C A341579 Stockmeyer et al. show that the number of steps in the solution is a(n), and that the sequence of steps is unique. They offer as exercises for the reader to prove that the number of exchanges with the solution is a(n-1), and that a(n) is the largest number of steps between any two configurations (in other words, a(n) is the diameter of the state graph). %H A341579 Kevin Ryde, <a href="/A341579/b341579.txt">Table of n, a(n) for n = 0..700</a> %H A341579 House of Graphs, graphs <a href="https://houseofgraphs.org/graphs/44105">44105</a>, <a href="https://houseofgraphs.org/graphs/44107">44107</a>, <a href="https://houseofgraphs.org/graphs/44109">44109</a>. Diameters = a(3..5). %H A341579 R. S. Scorer, P. M. Grundy, and C. A. B. Smith, <a href="http://www.jstor.org/stable/3606393">Some Binary Games</a>, The Mathematical Gazette, July 1944, volume 28, number 280, pages 96-103, section 4(iii) Plane Network Game. %H A341579 Paul K. Stockmeyer, C. Douglass Bateman, James W. Clark, Cyrus R. Eyster, Matthew T. Harrison, Nicholas A. Loehr, Patrick J. Rodriguez, and Joseph R. Simmons III, <a href="https://doi.org/10.1080/00207169508804452">Exchanging Disks in the Tower of Hanoi</a>, International Journal of Computer Mathematics, volume 59, number 1-2, pages 37-47, 1995. Also <a href="http://www.cs.wm.edu/~pkstoc/gov.pdf">author's copy</a>. a(n) = f(n) in section 3. %H A341579 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-1,2,-2). %H A341579 <a href="/index/To#Hanoi">Index entries for sequences related to Towers of Hanoi</a> %F A341579 a(n) = 2*A341580(n-1) + 1 for n>=1. [Stockmeyer et al.] %F A341579 a(n) = a(n-1) + a(n-2) + 2*a(n-4) + 3 for n>=4. [Stockmeyer et al.] %F A341579 a(n) = 2*a(n-1) - a(n-3) + 2*a(n-4) - 2*a(n-5). %F A341579 G.f.: x*(1 + x + x^2) / ( (1-x) * (1 - x - x^2 - 2*x^4) ). %F A341579 G.f.: -1/(1-x) + (1 + x + x^2 + 2*x^3)/(1 - x - x^2 - 2*x^4). %e A341579 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.), %e A341579 A %e A341579 / \ %e A341579 *---* n=3 disks %e A341579 / \ A to D %e A341579 * * a(3) = 7 steps %e A341579 / \ / \ %e A341579 *---B---*---* %e A341579 / \ %e A341579 * / \ * %e A341579 / \ / \ / \ %e A341579 *---C *---* %e A341579 / \ / \ %e A341579 * *-------* * %e A341579 / \ / \ / \ / \ %e A341579 D---*---*---* *---*---*---* %e A341579 The formula using A341580 is A to B distance A341580(2) = 3, the same (by symmetry) from D to C, and +1 from B to C. B to C is where the largest disk moves to the target peg (by exchange with the second-largest). %t A341579 A341579list[nmax_]:=LinearRecurrence[{2,0,-1,2,-2},{0,1,3,7,13},nmax+1];A341579list[50] (* _Paolo Xausa_, Jun 29 2023 *) %o A341579 (PARI) my(p=Mod('x,'x^4-'x^3-'x^2-2)); a(n) = subst(lift(p^n),'x,2) - 1; %Y A341579 Cf. A341580 (halfway), A341582 (first differences), A341583 (geometric length). %K A341579 nonn,easy %O A341579 0,3 %A A341579 _Kevin Ryde_, Feb 15 2021