OFFSET
0,3
COMMENTS
For n>=1, a(n) mod 2 = A010060(n) the Thue-Morse sequence - Benoit Cloitre, Mar 22 2004
Number of ternary words of length n in which count(0's) <= count(1's) <= count(2's). a(2) = 3: words 12 and 21 with counts (0,1,1) and 22 with counts (0,0,2). - David Scambler, Aug 06 2012
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = n!*sum(i+j+k=n, 1/(i!*j!*k!)) (0<=k<=j<=i<=n). - Benoit Cloitre, Mar 22 2004
Recurrence: (n-3)*(n-1)*n^2*(63*n^3-561*n^2+1556*n-1343)*a(n) = (n-1)^2*(315*n^5 - 4065*n^4 + 19720*n^3 - 44240*n^2 + 44790*n - 15768)*a(n-1) - 3*(63*n^4 - 813*n^3 + 3392*n^2 - 5091*n + 2241)*(n-2)^3*a(n-2) + 9*(n-3)*(126*n^5 - 1311*n^4 + 4801*n^3 - 7677*n^2 + 5409*n - 1464)*(n-2)*a(n-3) - 27*(n-3)*(315*n^5 - 4065*n^4 + 19720*n^3 - 44240*n^2 + 44790*n - 15768)*(n-2)*a(n-4) + 81*(n-4)*(n-3)*(63*n^4 - 813*n^3 + 3392*n^2 - 5091*n + 2241)*(n-2)*a(n-5) + 243*(n-5)*(n-4)*(n-3)*(63*n^3-372*n^2+623*n-285)*(n-2)*a(n-6). - Vaclav Kotesovec, Jun 30 2013
a(n) ~ 1/2 * 3^(n-1) * (1 + 3/(2*sqrt(Pi*n/3)) + sqrt(3)*(1+2*cos(2*Pi*n/3))/(Pi*n)). - Vaclav Kotesovec, Mar 07 2014
MAPLE
a:= n-> n! *add(add(1/(k!*j!*(n-k-j)!), j=k..(n-k)/2), k=0..n/3):
seq(a(n), n=0..40); # Alois P. Heinz, Aug 07 2012
MATHEMATICA
CoefficientList[Series[(HypergeometricPFQ[{}, {}, x]^3 + 3*HypergeometricPFQ[{}, {}, x]*HypergeometricPFQ[{}, {1}, x^2] + 2*HypergeometricPFQ[{}, {1, 1}, x^3])/6, {x, 0, 30}], x]*Range[0, 30]! (* Vaclav Kotesovec, Jul 01 2013 *)
PROG
(PARI) a(n)=sum(i=0, n, sum(j=0, i, sum(k=0, j, if(i+j+k-n, 0, n!/i!/j!/k!))))
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 20 2004
EXTENSIONS
More terms from Benoit Cloitre, Mar 22 2004
STATUS
approved