OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-5,5,1,-3,1)
FORMULA
From Andrew Howroyd, Sep 01 2018: (Start)
a(n) = n + Sum{k=1..n} (n-k+1)*(binomial(k+1, 2) - binomial(floor(k/2)+1, 2) - 1).
a(n) = 3*a(n-1) - a(n-2) - 5*a(n-3) + 5*a(n-4) + a(n-5) - 3*a(n-6) + a(n-7) for n > 7.
G.f.: x*(1 + x^2 + 2*x^3 - x^5)/((1 - x)^5*(1 + x)^2).
(End)
EXAMPLE
a(4) = 21 = (1 + 4 + 9 + 7), where (1, 4, 9, 7) = row 4 of triangle A175009.
PROG
(PARI) Vec((1 + x^2 + 2*x^3 - x^5)/((1 - x)^5*(1 + x)^2) + O(x^50)) \\ Andrew Howroyd, Sep 01 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Apr 03 2010
EXTENSIONS
Duplicate term removed and a(15) and beyond from Andrew Howroyd, Sep 01 2018
STATUS
approved