OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
G.f.: x*(1+16*x-8*x^2) / ( (1+x)*(1-x)^2 ). - R. J. Mathar, Mar 08 2011
From G. C. Greubel, May 16 2016: (Start)
E.g.f.: (1/4)*(23*exp(-x) + 9*(1 + 2*x)*exp(x) - 32).
a(n) = a(n-1) + a(n-2) - a(n-3). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = 1/8 + cot(Pi/9)*Pi/9. - Amiram Eldar, Feb 24 2023
a(n) = (1/4)*(18*n + 9 + 23*(-1)^n). - G. C. Greubel, Aug 04 2024
MATHEMATICA
CoefficientList[Series[(1 +16 x -8 x^2)/((1+x) (1-x)^2), {x, 0, 80}], x] (* Vincenzo Librandi, Sep 13 2013 *)
LinearRecurrence[{1, 1, -1}, {1, 17, 10}, 60] (* Harvey P. Dale, Dec 24 2014 *)
PROG
(Magma) [n eq 1 select 1 else 9*n-Self(n-1): n in [1..80]]; // Vincenzo Librandi, Sep 13 2013
(SageMath)
def A166524(n): return (9*n - 7 + 23*((n+1)%2))//2
[A166524(n) for n in range(1, 101)] # G. C. Greubel, Aug 04 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Oct 16 2009
STATUS
approved