OFFSET
0,5
COMMENTS
Number of binary words of length n with exactly one occurrence of subword 101 more than occurrences of subword 010. a(5) = 6: 01101, 10101, 10110, 10111, 11011, 11101. - Alois P. Heinz, Apr 23 2018
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..3327 (first 210 terms from R. H. Hardin)
FORMULA
Recursion: see Maple program. - Alois P. Heinz, Apr 23 2018
EXAMPLE
Both solutions for n=4
..0. .0
..1. .0
..0. .1
..0. .0
MAPLE
a:= proc(n) option remember; `if`(n<6, [0$3, 1, 2, 6][n+1],
((n+2)*(5*n^4-98*n^3+661*n^2-1680*n+1164) *a(n-1)
-4*(2*n^5-37*n^4+226*n^3-442*n^2-87*n+204) *a(n-2)
-2*(3*n^4-63*n^3+376*n^2-468*n+264) *a(n-3)
+2*(8*n^5-155*n^4+1060*n^3-3035*n^2+3738*n-1752) *a(n-4)
-4*(5*n^5-101*n^4+750*n^3-2450*n^2+3312*n-1248) *a(n-5)
+4*(2*n-9)*(n^4-16*n^3+85*n^2-150*n+48) *a(n-6)) /
((n+3)*(n^4-20*n^3+139*n^2-372*n+300)))
end:
seq(a(n), n=0..35); # Alois P. Heinz, Apr 23 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Mar 27 2017
STATUS
approved