login
G.f. A(x) satisfies A(x)^7-4*A(x)^6+(2x+6)*A(x)^5-(7x+4)*A(x)^4+(3x^2+8x+1)*A(x)^3-(5x^2+3x)*A(x)^2+(x^3+3x^2)*A(x)-x^3=0.
3

%I #6 Mar 14 2026 14:59:57

%S 0,1,2,8,41,241,1549,10609,76205,568016,4360514,34285365,274948040,

%T 2241563703,18530933242,155024266777,1310202864014,11171856536985,

%U 96000675068603,830578796200132,7229453998159332,63264663039028941,556292931608639795,4912732295552118304

%N G.f. A(x) satisfies A(x)^7-4*A(x)^6+(2x+6)*A(x)^5-(7x+4)*A(x)^4+(3x^2+8x+1)*A(x)^3-(5x^2+3x)*A(x)^2+(x^3+3x^2)*A(x)-x^3=0.

%C Number of n-vertex planar rooted trees with vertices colored red, blue, and green with green 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.

%H Nathan Fox, <a href="/A394158/b394158.txt">Table of n, a(n) for n = 0..300</a>

%H S. Dimitrov, N. Fox, K. Hadaway, A. Tharp, and S. Wagner, <a href="https://arxiv.org/abs/2602.16055">Counting Colored Trees</a>, arXiv:2602.16055 [math.CO], 2026.

%o (Python)

%o def A394158(n):

%o A = [[1, 1, 1], [1, 0, 1], [0, 1, 1]]

%o if n == 0:

%o return 0

%o m = len(A)

%o output = [[1] for i in range(m)]

%o for l in range(2, n + 1):

%o for i in range(m):

%o term = 0

%o for k in range(1, l):

%o for j in range(m):

%o term += A[i][j] * output[i][k - 1] * output[j][l - k - 1]

%o output[i].append(term)

%o return output[2][n - 1]

%Y Cf. A394156, A394157.

%K nonn

%O 0,3

%A _Nathan Fox_, Mar 12 2026