login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A248959
Number of ternary words of length n in which all digits 0..2 occur in every subword of 4 consecutive digits.
2
1, 3, 9, 27, 36, 72, 132, 240, 444, 816, 1500, 2760, 5076, 9336, 17172, 31584, 58092, 106848, 196524, 361464, 664836, 1222824, 2249124, 4136784, 7608732, 13994640, 25740156, 47343528, 87078324, 160162008, 294583860, 541824192, 996570060, 1832978112
OFFSET
0,2
COMMENTS
For n < 4 the constraint is voidly satisfied: each of the n-digit words satisfies the definition since there is no subword of length 4. - M. F. Hasler, Jan 13 2015
LINKS
FORMULA
G.f.: (1 + 2*x + 5*x^2 + 14*x^3 - 3*x^4 - 3*x^6)/(1 - x - x^2 - x^3). - Corrected by Colin Barker, Jan 12 2015
a(n) = a(n-1) + a(n-2) + a(n-3).
a(n) = A001590(n+1) * 12, for n>=4.
a(n) = A196700(n) * 6, for n>=4. - Alois P. Heinz, Jan 12 2015
MATHEMATICA
Join[{1, 3, 9, 27}, LinearRecurrence[{1, 1, 1}, {36, 72, 132}, 30]] (* Harvey P. Dale, Mar 12 2015 *)
PROG
(PARI) Vec((1+2*x+5*x^2+14*x^3-3*x^4-3*x^6)/(1-x-x^2-x^3) + O(x^100)) \\ Colin Barker, Jan 12 2015; extended to indices 0..3 by M. F. Hasler, Jan 13 2015
CROSSREFS
Sequence in context: A305617 A292390 A211219 * A070362 A027889 A360423
KEYWORD
nonn,easy
AUTHOR
Andrew Woods, Jan 12 2015
EXTENSIONS
a(0)-a(3) from M. F. Hasler, Jan 13 2015
STATUS
approved