%I #17 May 01 2024 09:01:11
%S 1,3,21,156,1221,9828,80580,669294,5612805,47419905,402993396,
%T 3441242544,29502452868,253778827695,2189249293266,18932541179706,
%U 164081616775173,1424741956592535,12392093363519415,107946143556797700,941580123046540596
%N Coefficient of x^n in the expansion of (1+x+x^2)^(3*n).
%H Seiichi Manyama, <a href="/A370170/b370170.txt">Table of n, a(n) for n = 0..1000</a>
%F a(n) = Sum_{k=0..floor(n/2)} binomial(3*n,k) * binomial(3*n-k,n-2*k).
%F The g.f. exp( Sum_{k>=1} a(k) * x^k/k ) has integer coefficients and equals (1/x) * Series_Reversion( x / (1+x+x^2)^3 ). See A365128.
%o (PARI) a(n, s=2, t=3, u=0) = sum(k=0, n\s, binomial(t*n, k)*binomial((t+u)*n-k, n-s*k));
%Y Cf. A370171, A370172.
%Y Cf. A365128.
%K nonn
%O 0,2
%A _Seiichi Manyama_, Feb 11 2024