login
A394157
G.f. A(x) satisfies A(x)^7+x*A(x)^6-2x*A(x)^5-x^2*A(x)^4+2x^2*A(x)^3-x^3*A(x)+x^4=0.
3
0, 1, 2, 9, 52, 340, 2395, 17736, 136156, 1074029, 8654041, 70930051, 589550373, 4957792102, 42107307872, 360675852281, 3112264077266, 27029371452916, 236083608533439, 2072482749835020, 18275920358494505, 161820500888016391, 1438085180352500918
OFFSET
0,3
COMMENTS
Number of n-vertex planar rooted trees with vertices colored red, blue, and green with blue root where red vertices can be followed by vertices of any colors, blue vertices can be followed red or green vertices, and green vertices can be followed by blue or green vertices.
LINKS
S. Dimitrov, N. Fox, K. Hadaway, A. Tharp, and S. Wagner, Counting Colored Trees, arXiv:2602.16055 [math.CO], 2026.
PROG
(Python)
def A394157(n):
A = [[1, 1, 1], [1, 0, 1], [0, 1, 1]]
if n == 0:
return 0
m = len(A)
output = [[1] for i in range(m)]
for l in range(2, n + 1):
for i in range(m):
term = 0
for k in range(1, l):
for j in range(m):
term += A[i][j] * output[i][k - 1] * output[j][l - k - 1]
output[i].append(term)
return output[1][n - 1]
CROSSREFS
Sequence in context: A301928 A394146 A069271 * A381782 A305987 A355789
KEYWORD
nonn
AUTHOR
Nathan Fox, Mar 12 2026
STATUS
approved