OFFSET
2,2
COMMENTS
a(n)/6 is the number of ternary strings of length n that contain exactly three 0's, at most one 1 and any number of 2's. For example, a(3)/6 counts the string 000; a(6)/6 = 80 counts the 60 permutations of 000122 plus the 20 permutations of 000222. - Enrique Navarrete, Feb 19 2026
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 2..1000
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
From R. J. Mathar, May 01 2014: (Start)
G.f.: -6*x^3*(1+3*x) / (x-1)^5.
a(n) = 6*A002417(n-2). (End)
a(n) = A245334(n,3), n > 2. - Reinhard Zumkeller, Aug 31 2014
From Amiram Eldar, Jan 15 2023: (Start)
Sum_{n>=3} 1/a(n) = Pi^2/12 - 5/8.
Sum_{n>=3} (-1)^(n+1)/a(n) = Pi^2/24 - 2*log(2) + 9/8. (End)
From Enrique Navarrete, Feb 19 2026: (Start)
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5).
a(n) - a(n-1) = 6*A002412(n-2).
A034263(n-3) = (1/6)*Sum_{k=2..n} a(k).
E.g.f.: x^3*(x + 1)*exp(x). (End)
MATHEMATICA
a[n_] := n*(n-1)*(n-2)^2; Array[a, 50, 2] (* Amiram Eldar, Jan 15 2023 *)
PROG
(Magma) [n*(n-1)*(n-2)^2: n in [2..40]]; // Vincenzo Librandi, May 02 2011
(Haskell)
a047927 n = if n == 2 then 0 else a245334 n 3
-- Reinhard Zumkeller, Aug 31 2014
(PARI) a(n)=n*(n-1)*(n-2)^2 \\ Charles R Greathouse IV, Oct 07 2015
(SageMath) [n*(n-1)*(n-2)^2 for n in range(2, 40)] # Stefano Spezia, Apr 02 2026
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
EXTENSIONS
Offset changed from 0 to 2 by Vincenzo Librandi, May 02 2011
STATUS
approved
