login
Number of n-length words w over a 6-ary alphabet {a_1,...,a_6} such that w contains never more than j consecutive letters a_j (for 1<=j<=6).
2

%I #16 Aug 15 2024 17:06:11

%S 1,6,35,204,1188,6919,40295,234672,1366694,7959418,46354440,269961210,

%T 1572213035,9156329637,53325071447,310557107219,1808637367513,

%U 10533228997581,61343923944270,357257684774972,2080614429665859,12117182049311250,70568625653399251

%N Number of n-length words w over a 6-ary alphabet {a_1,...,a_6} such that w contains never more than j consecutive letters a_j (for 1<=j<=6).

%H Geoffrey Critzer and Alois P. Heinz, <a href="/A242629/b242629.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_17">Index entries for linear recurrences with constant coefficients</a>, signature (3,10,26,49,81,114,148,170,181,174,155,123,90,57,32,14,5).

%F G.f.: -(x^6+x^5+x^4+x^3+x^2+x+1) *(x+1)*(x^2-x+1) *(x^2+x+1) *(x^4+x^3+x^2+x+1) *(x^2+1) / (5*x^17 +14*x^16 +32*x^15 +57*x^14 +90*x^13 +123*x^12 +155*x^11 +174*x^10 +181*x^9 +170*x^8 +148*x^7 +114*x^6 +81*x^5 +49*x^4 +26*x^3 +10*x^2 +3*x-1).

%p b:= proc(n, k, c, t) option remember;

%p `if`(n=0, 1, add(`if`(c=t and j=c, 0,

%p b(n-1, k, j, 1+`if`(j=c, t, 0))), j=1..k))

%p end:

%p a:= n-> b(n, 6, 0$2):

%p seq(a(n), n=0..30);

%Y Column k=6 of A242464.

%K nonn,easy

%O 0,2

%A _Geoffrey Critzer_ and _Alois P. Heinz_, May 19 2014