OFFSET
0,3
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (10,-40,82,-91,52,-12).
FORMULA
E.g.f.: (exp(x)-x)^3.
For n>3: a(n) = 3^n - 3*n*2^(n-1) + 3*n*(n-1).
G.f.: -(72*x^9 -312*x^8 +546*x^7 -492*x^6 +325*x^5 -202*x^4 +109*x^3 -43*x^2 +10*x -1) / ((x -1)^3*(2*x -1)^2*(3*x -1)). - Colin Barker, Nov 30 2014
EXAMPLE
a(2)=3 because we have (letting our alphabet be {0,1,2}) three length two sequences: (0,0), (1,1), (2,2).
a(3)=3 because we have: (0,0,0), (1,1,1), (2,2,2).
MATHEMATICA
nn=20; a=Exp[x]-x; Range[0, nn]! CoefficientList[Series[a^3, {x, 0, nn}], x]
LinearRecurrence[{10, -40, 82, -91, 52, -12}, {1, 0, 3, 3, 21, 63, 243, 969, 3657, 12987}, 30] (* Harvey P. Dale, Aug 20 2015 *)
PROG
(PARI) Vec(-(72*x^9 -312*x^8 +546*x^7 -492*x^6 +325*x^5 -202*x^4 +109*x^3 -43*x^2 +10*x -1) / ((x -1)^3*(2*x -1)^2*(3*x -1)) + O(x^100)) \\ Colin Barker, Nov 30 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Geoffrey Critzer, Mar 20 2012
STATUS
approved