OFFSET
0,4
COMMENTS
Let T(n,k) be the number of words of length n with an alphabet of size M where the first k=M-1 letters of the alphabet appear with the same frequency f in each word. Then T(n,k) = Sum_{f=0..n/k) Product_{i=0..k-1} binomial(n-i*f,f) and a(n) = T(n,3), A002426(n)=T(n,2). Removing the words with cycles by the inclusion-exclusion principle by a Mobius Transform gives words of length n of that type without cycles and division through n the Lyndon words of that type, A349002. - R. J. Mathar, Nov 07 2021
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
FORMULA
D-finite with recurrence n^2*a(n) = (28*n^2 - 84*n + 56)*a(n-3) - 3*(n - 1)^2*a(n-2) + (3*n^2 - 3*n + 1)* a(n-1) for n >= 4.
From Haoran Chen, Jun 22 2021: (Start)
a(n) ~ 2 * 4^n/(sqrt(3) * n * Pi).
a(n) = [(x*y)^0] (1 + x + y + 1/(x * y))^n. (End)
a(n) = Sum_{k=0..floor(n/3)} n!/(k!^3*(n-3*k)!). - Andrew Howroyd, Jan 14 2023
MAPLE
a := n -> hypergeom([-n/3, (1 - n)/3, (2 - n)/3], [1, 1], -27):
seq(simplify(a(n)), n = 0..27);
a := proc(n) option remember; if n < 4 then [1, 1, 1, 7][n+1] else
((28*n^2 - 84*n + 56)*a(n - 3) - 3*(n - 1)^2*a(n - 2) + (3*n^2 - 3*n + 1)*a(n - 1))/ n^2 fi end: seq(a(n), n = 0..27);
MATHEMATICA
Table[HypergeometricPFQ[{-n/3, (1 - n)/3, (2 - n)/3}, {1, 1}, -27], {n, 0, 27}] (* Amiram Eldar, Jun 22 2021 *)
PROG
(PARI) a(n)=sum(k=0, n\3, n!/(k!^3*(n-3*k)!)) \\ Andrew Howroyd, Jan 14 2023
(Python)
from sympy import hyperexpand, Rational
from sympy.functions import hyper
def A344560(n): return hyperexpand(hyper((Rational(-n, 3), Rational(1-n, 3), Rational(2-n, 3)), (1, 1), -27)) # Chai Wah Wu, Jan 04 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jun 01 2021
STATUS
approved