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
a(n) = 5*n - a(n-1) for n > 1, with a(1) = 1.
G.f. x*(1+8*x-4*x^2) / ( (1+x)*(1-x)^2 ). - R. J. Mathar, Mar 08 2011
From G. C. Greubel, May 16 2016: (Start)
E.g.f.: (5*(1 + 2*x)*exp(x) + 11*exp(-x) - 16)/4.
a(n) = a(n-1) + a(n-2) - a(n-3). (End)
MATHEMATICA
Table[5 n / 2 + 11 (-1)^n / 4 + 5 / 4, {n, 100}] (* Vincenzo Librandi, Sep 13 2013 *)
PROG
(Magma) [5*n/2 + 11*(-1)^n/4 +5/4: n in [1..80]]; // Vincenzo Librandi, Sep 13 2013
(SageMath)
def A166520(n): return (5*n -3 +11*((n+1)%2))//2
[A166520(n) for n in range(1, 101)] # G. C. Greubel, Aug 03 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Oct 16 2009
STATUS
approved