login
A209528
The number of length n ternary sequences in which no symbol appears exactly once.
1
1, 0, 3, 3, 21, 63, 243, 969, 3657, 12987, 43959, 143685, 458109, 1435047, 4439451, 13612257, 41474577, 125798643, 380343519, 1147320285, 3455328261, 10394294175, 31242648963, 93853773369, 281825558361, 846030320043, 2539248584583, 7620161669109
OFFSET
0,3
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
Cf. A130102.
Sequence in context: A230647 A130723 A369078 * A369751 A214778 A180754
KEYWORD
nonn,easy
AUTHOR
Geoffrey Critzer, Mar 20 2012
STATUS
approved