OFFSET
3,1
LINKS
Colin Barker, Table of n, a(n) for n = 3..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-1,-1).
FORMULA
G.f.: 1+1/(1-x-x^2)-1/(1-x)-1/(1-x^2).
From Colin Barker, Jul 13 2017: (Start)
a(n) = (-20 + sqrt(5)*(-(1-sqrt(5))^(1+n) + (1+sqrt(5))^(1+n))/2^n) / 10 for n even.
a(n) = (-10 + sqrt(5)*(-(1-sqrt(5))^(1+n) + (1+sqrt(5))^(1+n))/2^n) / 10 for n odd.
a(n) = a(n-1) + 2*a(n-2) - a(n-3) - a(n-4) for n>6. (End)
a(n) = Sum_{i=1..floor((n-1)/2)} C(n-i,i). - Wesley Ivan Hurt, Sep 19 2017
EXAMPLE
a(9) = 54. The tuples are (22221) = 5!/4! = 5, (222111) = 6!/3!/3! = 20, (2211111) = 7!/5!/2! = 21, (21111111) = 8!/7! = 8.
MATHEMATICA
LinearRecurrence[{1, 2, -1, -1}, {2, 3, 7, 11}, 50] (* Harvey P. Dale, Dec 20 2014 *)
PROG
(PARI) Vec(1+1/(1-x-x^2)-1/(1-x)-1/(1-x^2)+O(x^66)) \\ Joerg Arndt, Aug 04 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Neil McGrath, Jul 31 2014
STATUS
approved