OFFSET
0,3
COMMENTS
Column 2 of A105422.
LINKS
Jia Huang, Partially Palindromic Compositions, J. Int. Seq. (2023) Vol. 26, Art. 23.4.1. See pp. 4, 11.
J. J. Madden, A generating function for the distribution of runs in binary words, arXiv:1707.04351 [math.CO], 2017. Theorem 1.1, r=1, k=2.
Index entries for linear recurrences with constant coefficients, signature (3, 0, -5, 0, 3, 1).
FORMULA
G.f.: (1-z)^3/(1-z-z^2)^3.
a(n) = (1/50) [(5n^2+21n+25)*Lucas(n) - (11n^2+30n+10)*Fibonacci(n) ]. - Ralf Stephan, Jun 01 2007
EXAMPLE
a(4)=9 because we have (1,1,4),(1,4,1),(4,1,1),(1,1,2,2),(1,2,1,2),(1,2,2,1),(2,1,1,2),(2,1,2,1) and (2,2,1,1).
MAPLE
G:=(1-z)^3/(1-z-z^2)^3: Gser:=series(G, z=0, 42): 1, seq(coeff(Gser, z^n), n=1..40);
MATHEMATICA
LinearRecurrence[{3, 0, -5, 0, 3, 1}, {1, 0, 3, 3, 9, 15}, 40] (* Jean-François Alcover, Jul 23 2018 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Apr 07 2005
STATUS
approved