%I #13 Jun 04 2026 04:56:18
%S 0,1,3,14,77,460,2892,18838,125999,860410,5974998,42074616,299785646,
%T 2157615484,15664666260,114596758656,843977389437,6252656070700,
%U 46568577487040,348479403676142,2618857896150888,19756973221959766,149571500476890750,1135960161318209766
%N G.f. A(x) satisfies A(x)^4 + (x-1)*A(x)^3 + 3*x*A(x)^2 + (x^2-x)*A(x) + x^2 = 0.
%C Number of n-vertex planar rooted trees with vertices colored red, blue, and green with blue root where red vertices can only occur as leaves, blue vertices can be followed by vertices of any color, and green vertices can be followed by red or green vertices.
%H Nathan Fox, <a href="/A394120/b394120.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.
%F a(n) ~ 41^(1/4) * 2^(3*n - 5/2) / (sqrt(3*Pi) * n^(3/2) * (33 - 5*sqrt(41))^(n - 1/2)). - _Vaclav Kotesovec_, Jun 04 2026
%p series(RootOf(A^4+(x-1)*A^3+3*x*A^2+(x^2-x)*A+x^2,A),x,24):
%p gfun[seriestolist](%)[]; # _Alois P. Heinz_, Mar 15 2026
%o (Python)
%o def A394120(n):
%o A = [[0, 0, 0], [1, 1, 1], [1, 0, 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[1][n - 1]
%K nonn
%O 0,3
%A _Nathan Fox_, Mar 11 2026
%E Definition corrected by _Georg Fischer_, Mar 15 2026