login
A027560
Number of 5-balanced strings of length n: let d(S)= #(1)'s in S - #(0)'s, then S is k-balanced if every substring T has -k<=d(T)<=k; here k=5.
1
1, 2, 4, 8, 16, 32, 62, 122, 232, 450, 846, 1622, 3026, 5748, 10664, 20106, 37144, 69608, 128164, 238984, 438826, 814874, 1492908, 2762562, 5051602, 9320014, 17014950, 31311964, 57084732, 104819474, 190865620, 349797128, 636274832
OFFSET
0,2
FORMULA
a_n = a_{n-1} + 5a_{n-2} - 4a_{n-3} - 6a_{n-4} + 3a_{n-5}.
G.f. (1+x-3x^2-2x^3+2x^4-x^5) / (1-x-2x^2+x^3)(1-3x^2). - David Callan, Jul 22 2008
MATHEMATICA
Join[{1}, LinearRecurrence[{1, 5, -4, -6, 3}, {2, 4, 8, 16, 32}, 40]] (* Harvey P. Dale, May 01 2013 *)
CROSSREFS
Sequence in context: A059173 A355520 A274005 * A135493 A216241 A283837
KEYWORD
nonn
STATUS
approved