%I #37 Dec 23 2024 21:51:17
%S 1,1,1,7,25,61,211,841,2857,9745,36421,134971,488731,1807807,6788965,
%T 25384087,95114377,359291737,1361265889,5162682775,19642369405,
%U 74960720065,286563664135,1097430871285,4211301910795,16187715501811,62311953400711,240203420513161
%N a(n) = hypergeom([-n/3, (1 - n)/3, (2 - n)/3], [1, 1], -27).
%C 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
%H Andrew Howroyd, <a href="/A344560/b344560.txt">Table of n, a(n) for n = 0..1000</a>
%F 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.
%F From _Haoran Chen_, Jun 22 2021: (Start)
%F a(n) ~ 2 * 4^n/(sqrt(3) * n * Pi).
%F a(n) = [(x*y)^0] (1 + x + y + 1/(x * y))^n. (End)
%F a(n) = Sum_{k=0..floor(n/3)} n!/(k!^3*(n-3*k)!). - _Andrew Howroyd_, Jan 14 2023
%p a := n -> hypergeom([-n/3, (1 - n)/3, (2 - n)/3], [1, 1], -27):
%p seq(simplify(a(n)), n = 0..27);
%p a := proc(n) option remember; if n < 4 then [1, 1, 1, 7][n+1] else
%p ((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);
%t Table[HypergeometricPFQ[{-n/3, (1 - n)/3, (2 - n)/3}, {1, 1}, -27], {n, 0, 27}] (* _Amiram Eldar_, Jun 22 2021 *)
%o (PARI) a(n)=sum(k=0, n\3, n!/(k!^3*(n-3*k)!)) \\ _Andrew Howroyd_, Jan 14 2023
%o (Python)
%o from sympy import hyperexpand, Rational
%o from sympy.functions import hyper
%o 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
%Y Cf. A344559.
%K nonn
%O 0,4
%A _Peter Luschny_, Jun 01 2021