OFFSET
1,4
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.
LINKS
Wikipedia, Chip-firing game.
EXAMPLE
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.
PROG
(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)
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Tanya Khovanova and the MIT PRIMES STEP senior group, Dec 12 2024
STATUS
approved