A119827 Number of ternary words of length n with exactly one 000.
0, 0, 0, 1, 4, 16, 60, 212, 728, 2444, 8064, 26256, 84576, 270048, 855936, 2696080, 8446912, 26341696, 81812544, 253181888, 781005440, 2402311616, 7370247168, 22558917120, 68901651456, 210037106688, 639127277568, 1941624275200, 5889576530944, 17839902853120
Offset: 0
Examples
a(4)=4 because we have 0001, 0002, 1000 and 2000.
Links
- Index entries for linear recurrences with constant coefficients, signature (4,0,-4,-12,-8,-4).
Programs
-
Maple
h:=z^3/(1-2*z-2*z^2-2*z^3)^2: hser:=series(h,z=0,33): seq(coeff(hser,z,n), n=0..30);
-
Mathematica
LinearRecurrence[{4,0,-4,-12,-8,-4},{0,0,0,1,4,16},40] (* Harvey P. Dale, Jan 28 2021 *)
Formula
G.f.: z^3/(1-2z-2z^2-2z^3)^2.
Comments