OFFSET
0,3
COMMENTS
A border of a string w is a nonempty proper prefix of w that is also a suffix. The LB ("longest border") factorization of a string w is as follows: if w has no border, then the factorization is just (w). Otherwise, write w = (x)(w')(x) where x is the longest border of length <= |w|/2, and continue with w'. The length of the factorization is the number of factors. For example, 0101101010 = (010)(1)(10)(1)(010), and so has length 5.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-2,2,-1).
FORMULA
For n >= 0, we have a(8n+i) = 6n+i for 0 <= i <= 5, and a(8n+6) = a(8n+7) = 6n+5.
From Colin Barker, May 01 2020: (Start)
G.f.: x*(1 + x^2 + x^4 - x^5 + x^6) / ((1 - x)^2*(1 + x^2)*(1 + x^4)).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - 2*a(n-4) + 2*a(n-5) - 2*a(n-6) + 2*a(n-7) - a(n-8) for n>7.
(End)
EXAMPLE
For n = 7 an example achieving a(7) = 5 is 0101100 = (0)(10)(1)(10)(0).
PROG
(PARI) concat(0, Vec((1 + x^2 + x^4 - x^5 + x^6)/((-1 + x)^2*(1 + x^2 + x^4 + x^6)) + O(x^70))) \\ Jinyuan Wang, May 01 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jeffrey Shallit, Apr 30 2020
EXTENSIONS
More terms from Jinyuan Wang, May 01 2020
STATUS
approved