cp's OEIS Frontend

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.

A347789 a(n) is the number of times that only 2 pegs have disks on them during the optimal solution to a Towers of Hanoi problem with n disks.

Original entry on oeis.org

0, 2, 4, 8, 12, 20, 28, 44, 60, 92, 124, 188, 252, 380, 508, 764, 1020, 1532, 2044, 3068, 4092, 6140, 8188, 12284, 16380, 24572, 32764, 49148, 65532, 98300, 131068, 196604, 262140, 393212, 524284, 786428, 1048572, 1572860, 2097148, 3145724, 4194300, 6291452
Offset: 1

Views

Author

John Bonomo, Sep 13 2021

Keywords

Comments

Zero together with the partial sum of the even terms of A016116. - Omar E. Pol, Sep 14 2021
For n >= 2, a(n+1) is the number of n X n arrays of 0's and 1's with every 2 X 2 square having density exactly 1. - David desJardins, Oct 27 2022

Crossrefs

The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<3, 2*n-2, 2*(a(n-2)+2))
        end:
    seq(a(n), n=1..42);  # Alois P. Heinz, Sep 14 2021
  • Mathematica
    LinearRecurrence[{1, 2, -2}, {0, 2, 4}, 42] (* Jean-François Alcover, May 14 2022 *)
  • PARI
    a(n) = (3+(n % 2))*(2^(n\2)) - 4; \\ Michel Marcus, Sep 14 2021
    
  • Python
    def a(n): return (3 + n%2) * 2**(n//2) - 4
    print([a(n) for n in range(1, 43)]) # Michael S. Branicky, Sep 14 2021

Formula

a(n) = (3+(n mod 2))*(2^floor(n/2)) - 4.
a(n) = 4 * A052955(n-3) for n >= 3. - Joerg Arndt, Sep 14 2021
a(n) = A027383(n) - 2. - Omar E. Pol, Sep 14 2021
a(n) = 2 * A027383(n-2) for n >= 2. - Alois P. Heinz, Sep 14 2021
From Stefano Spezia, Sep 14 2021: (Start)
G.f.: 2*x^2*(1+x)/((1-x)*(1-2*x^2)).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) for n > 3. (End)