OFFSET
0,6
LINKS
Wikipedia, Autocorrelation (words)
Index entries for linear recurrences with constant coefficients, signature (4,-5,4,-5,2).
FORMULA
G.f.: x^4/((1-2*x) * (x^4 + (1-2*x) * (1+x^2))). Equivalently, 1/(1-2*x) - (1+x^2)/(x^4 + (1-2*x) * (1+x^2)).
a(n) = 4*a(n-1) - 5*a(n-2) + 4*a(n-3) - 5*a(n-4) + 2*a(n-5).
a(n) = 2^n - A118870(n).
EXAMPLE
a(5) = 4: the words are aabab, ababa, ababb, babab.
PROG
(PARI) my(N=40, x='x+O('x^N)); concat([0, 0, 0, 0], Vec(x^4/((1-2*x)*(x^4+(1-2*x)*(1+x^2)))))
CROSSREFS
KEYWORD
nonn,easy,new
AUTHOR
Seiichi Manyama, Jul 12 2026
STATUS
approved
