A269916 Number of ternary strings of length n with maximal run length four containing 11112.
1, 5, 21, 81, 296, 1043, 3585, 12095, 40221, 132225, 430633, 1391623, 4467689, 14262766, 45311977, 143343279, 451768405, 1419092951, 4444424613, 13882255419, 43256925753, 134492621659, 417322590000, 1292554593007, 3996626787973, 12338508959035, 38037021764053
Offset: 5
Keywords
Links
- Math StackExchange, Words built with 0,1,2
- Marko Riedel, Maple code by total enumeration and by generating function.
- Index entries for linear recurrences with constant coefficients, signature (3,3,-1,-9,-25,-39,-45,-43,-32,-18,-8,-2).
Programs
-
Mathematica
Drop[CoefficientList[Series[x^5 (x + 1) (x^2 + 1) (x^4 + x^3 + x^2 + x + 1)/((x^8 + 3 x^7 + 5 x^6 + 7 x^5 + 7 x^4 + 5 x^3 + 3 x^2 + x - 1) (2 x^4 + 2 x^3 + 2 x^2 + 2 x - 1)), {x, 0, 31}], x], 5] (* Michael De Vlieger, Mar 08 2016 *)
Formula
G.f.: x^5*(x+1)*(x^2+1)*(x^4+x^3+x^2+x+1) / ((x^8+3*x^7+5*x^6+7*x^5 +7*x^4+5*x^3+3*x^2+x-1) * (2*x^4+2*x^3+2*x^2+2*x-1)).