A242495 Number of length n words on {1,2,3,4} with at most one consecutive 1 and at most two consecutive 2's and at most three consecutive 3's and at most four consecutive 4's.
1, 4, 15, 56, 208, 773, 2872, 10672, 39655, 147350, 547523, 2034486, 7559742, 28090486, 104378617, 387850022, 1441172953, 5355109869, 19898515060, 73938894118, 274742112508, 1020886629235, 3793410119173, 14095551768590
Offset: 0
Examples
a(3) = 56 because there are 64 length 3 words on {1,2,3,4} but we don't count 111, 112, 113, 114, 211, 222, 311, or 411.
Links
- Fung Lam, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1, 5, 12, 18, 22, 20, 15, 8, 3).
Crossrefs
Cf. A242452.
Programs
-
Mathematica
nn=23;CoefficientList[Series[1/(1-Sum[v[i]/(1+v[i])/.v[i]->(z-z^(i+1))/(1-z),{i,1,4}]),{z,0,nn}],z]
Formula
G.f.: (1 + x)*(1 + x^2)*(1 + x + x^2 )*(1 + x + x^2 + x^3 + x^4)/(1 - x - 5*x^2 - 12*x^3 - 18*x^4 - 22*x^5 - 20*x^6 - 15*x^7 - 8*x^8 - 3*x^9). (corrected by Fung Lam, May 18 2014)
Comments