A081909 a(n) = 3^n(n^2 - n + 18)/18.
1, 3, 10, 36, 135, 513, 1944, 7290, 26973, 98415, 354294, 1259712, 4428675, 15411789, 53144100, 181752822, 617003001, 2080591515, 6973568802, 23245229340, 77096677311, 254535261273, 836828256240, 2740612539186
Offset: 0
Examples
a(2)=10 since the number of words of length 2 defined on {0,1,2,3} that don't use 0 or use it twice are 12, 21, 13, 31, 23, 32, 11, 22, 33, 00. - _Enrique Navarrete_, Mar 29 2024
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..185
- Index entries for linear recurrences with constant coefficients, signature (9,-27,27).
Programs
-
Magma
[3^n*(n^2-n+18)/18: n in [0..40]]; // Vincenzo Librandi, Apr 27 2011
-
Mathematica
Table[3^n(n^2-n+18)/18,{n,0,30}] (* or *) CoefficientList[Series[ (1-6x+10x^2)/(1-3x)^3,{x,0,30}],x] (* Harvey P. Dale, Apr 26 2011 *)
Formula
a(n) = 3^n*(n^2 - n + 18)/18.
G.f.: (1 - 6x + 10x^2)/(1-3x)^3.
E.g.f.: exp(3*x)*(1+x^2/2). - Enrique Navarrete, Mar 29 2024
Comments