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 A128202 #16 Mar 31 2024 19:03:51 %S A128202 0,2,5,4,22,21,24,26,53,52,46,45,36,38,41,40,202,201,204,206,197,196, %T A128202 190,189,216,218,221,220,238,237,240,242,485,484,478,477,468,470,473, %U A128202 472,418,417,420,422,413,412,406,405,324,326,329,328,346,345,348,350 %N A128202 Configuration of discs on pegs after n steps of the optimal solution to the Towers of Hanoi problem moving an odd number of discs from peg 0 to peg 2, or an even number from peg 0 to peg 1. %C A128202 From _Kevin Ryde_, Oct 21 2021: (Start) %C A128202 Configurations are encoded in ternary where the least significant digit is the peg number (0,1,2) which is the location of the smallest disc, the second least significant is the location of the second smallest disc, and so on. %C A128202 This encoding and these configurations are as in A055661 except that the roles of pegs 1 and 2 are swapped, so ternary digit flip 1<->2, and so a(n) = A004488(A055661(n)). %C A128202 (End) %H A128202 Zoran Šunić, <a href="https://arxiv.org/abs/math/0612080">Tree morphisms, transducers and integer sequences</a>, arXiv:math/0612080 [math.CO], 2006, see after proposition 5.4. %H A128202 <a href="/index/To#Hanoi">Index entries for sequences related to Towers of Hanoi</a> %o A128202 (PARI) a(n) = my(v=binary(bitxor(n,n>>1)),s=(-1)^#v,d=0); for(i=1,#v, if(v[i],d=(d+s)%3,s=-s); v[i]=d); fromdigits(v,3); \\ _Kevin Ryde_, Oct 21 2021 %Y A128202 Cf. A007089 (ternary), A004488 (ternary 1<->2). %Y A128202 Cf. A055661 (pegs 1<->2). %K A128202 base,nonn %O A128202 1,2 %A A128202 _Ralf Stephan_, May 09 2007 %E A128202 Name and data corrected and extended by _Kevin Ryde_, Oct 21 2021