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.

A378962 First differences of A378726.

Original entry on oeis.org

1, 1, 1, 5, 1, 1, 5, 1, 1, 5, 1, 1, 18, 1, 1, 5, 1, 1, 5, 1, 1, 18, 1, 1, 5, 1, 1, 5, 1, 1, 18, 1, 1, 5, 1, 1, 5, 1, 1, 58, 1, 1, 5, 1, 1, 5, 1, 1, 18, 1, 1, 5, 1, 1, 5, 1, 1, 18, 1, 1, 5, 1, 1, 5, 1, 1, 58, 1, 1, 5, 1, 1, 5, 1
Offset: 1

Views

Author

Tanya Khovanova and the MIT PRIMES STEP senior group, Dec 12 2024

Keywords

Comments

Sequence A378726(n) is defined to be the total number of fires on a rooted undirected infinite ternary tree with a self-loop at the root, when a chip-firing process starts with 3n chips at the root. The total number of fires for 3n, 3n-1, and 3n-2 chips are the same, so the sequence is defined for one of these three values to remove duplicates.
The corresponding sequence for binary trees is A376132; its distinct values are Eulerian numbers A000295.
The distinct values of this sequence form sequence A000340.

Examples

			The total number of fires when starting with 12 chips at the root is 3, and the total number of fires when starting with 15 chips at the root is 8. This means that a(4) = 5.
		

Crossrefs

Programs

  • Python
    import math
    def F(N, k):
        n = int(math.log(N * (k - 1) + 1, k))
        a = [0] * (n + 1)
        num = N - ((k ** n) - 1)/(k - 1)
        for i in range(n, -1, -1):
            if k ** i <= num:
                a[i] = int(num/(k ** i))
                num %= (k ** i)
        res = 0
        for j in range(1, n):
            x = int((j * (k ** (j + 1)) - (j + 1) * (k ** j) + 1)/((k - 1) ** 2))
            res += x * (a[j] + 1)
        return res
    s = ""
    for N in range(1, 200):
        s += str(int(F(3 * N + 3, 3) - F(3 * N, 3)))
        s += ", "
    print(s)

Formula

a(n) = A000340(A378724(n+1)-A378724(n)-1).