login
A391470
Number of words of length 3*n that can be formed with a three-letter alphabet when the number of letters of each type is == 2 (mod 3).
3
0, 0, 90, 2268, 58806, 1592136, 43053282, 1162320516, 31380882462, 847287015120, 22876797237930, 617673439330668, 16677181570526406, 450283904728735896, 12157665462543713202, 328256967425918137236, 8862938119558357917102, 239299329229770240980640
OFFSET
0,3
COMMENTS
See comments in A391468.
FORMULA
a(n) = Sum_{n1+n2+n3=n-2} trinomial(3*n; 3*n1 + 2, 3*n2 + 2, 3*n3 + 2) for n>=2.
a(n) = 3^(3*n-2) - ((1 + (-1)^n) - (1 - (-1)^n)*i*sqrt(3))*i^n*3^((3*n-2)/2)/2 for n>=1, where i is the imaginary unit.
a(n) = 27*(a(n-1) - a(n-2) + 27*a(n-3)), for n >= 4.
G.f.: 18*x^2*(5 - 9*x)/((1 - 27*x)*(1 + 27*x^2)).
a(n) + A391468(n) + A391469(n) + 2*A013733(n-1) = 3^(3*n) for n>=1.
E.g.f.: (2 + exp(27*x) - 3*cos(3*sqrt(3)*x) - 3*sqrt(3)*sin(3*sqrt(3)*x))/9. - Stefano Spezia, Dec 30 2025
EXAMPLE
For n=2, the words are permutations of A,A,B,B,C,C and there are a(0) = trinomial(6;2,2,2) = 6!/(2!*2!*2!) = 90 of them.
MATHEMATICA
LinearRecurrence[{27, -27, 729}, {0, 0, 90, 2268}, 20] (* Paolo Xausa, Jan 16 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Pablo Serra, Dec 29 2025
STATUS
approved