OFFSET
0,2
COMMENTS
a(n) = Sum(k*A129714(n,k), k=0..n).
a(n) = A241701(3n+1,n) for n>0. - Alois P. Heinz, Apr 27 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
W. Kuszmaul, Fast Algorithms for Finding Pattern Avoiders and Counting Pattern Occurrences in Permutations, arXiv preprint arXiv:1509.08216, 2015
Index entries for linear recurrences with constant coefficients, signature (2,1,-2,-1).
FORMULA
G.f.: z(2+z-z^2-z^3)/(1-z-z^2)^2. Rec. rel.: a(n)=a(n-1)+a(n-2)+2F(n) for n>=3, where F(n) is a Fibonacci number (F(0)=0,F(1)=1).
EXAMPLE
a(3)=11 because in the Fibonacci binary words 011, 111, 101, 010 and 110 we have a total of 2+1+3+3+2=11 runs.
MAPLE
with(combinat): a[0]:=0: a[1]:=2: a[2]:=5: for n from 3 to 40 do a[n]:=a[n-1]+a[n-2]+2*fibonacci(n) od: seq(a[n], n=0..40);
MATHEMATICA
CoefficientList[Series[x (2 + x - x^2 - x^3)/(1 - x - x^2)^2, {x, 0, 30}], x] (* Vincenzo Librandi, Apr 28 2014 *)
LinearRecurrence[{2, 1, -2, -1}, {0, 2, 5, 11, 22}, 40] (* Harvey P. Dale, Nov 09 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, May 12 2007
STATUS
approved