login
A394142
G.f. A(x) satisfies (x+1)*A(x)^5-(x+2)*A(x)^4+(2x^2+3x+1)*A(x)^3-(x^2+3x)*A(x)^2+3x^2*A(x)-x^3=0.
3
0, 1, 2, 7, 31, 158, 888, 5372, 34430, 231116, 1610639, 11572782, 85262374, 641278125, 4906551925, 38082333652, 299161679020, 2374285935782, 19009255256765, 153349252634092, 1245249010912888, 10170369472358633, 83489241602340722, 688481467240020797
OFFSET
0,3
COMMENTS
Number of n-vertex planar rooted trees with vertices colored red, blue, and green with green root where red vertices can only be followed by blue vertices, blue vertices can be followed by vertices of any colors, and green vertices can be followed by red 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 A394142(n):
A = [[0, 1, 0], [1, 1, 1], [1, 0, 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[2][n - 1]
CROSSREFS
Sequence in context: A030945 A088554 A107595 * A193320 A030882 A273957
KEYWORD
nonn
AUTHOR
Nathan Fox, Mar 11 2026
STATUS
approved