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) = 6*n - a(n-1), for n > 1, with a(1) = 1.
G.f.: x*(1+10*x-5*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/2)*(7*exp(-x) + 3*(1+2*x)*exp(x) -10).
a(n) = a(n-1) + a(n-2) - a(n-3). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = 1/5 + Pi/(2*sqrt(3)). - Amiram Eldar, Feb 24 2023
MATHEMATICA
Table[(6 n + 7 (-1)^n + 3)/2, {n, 60}] (* Vincenzo Librandi, Sep 13 2013 *)
LinearRecurrence[{1, 1, -1}, {1, 11, 7}, 90] (* Harvey P. Dale, Apr 29 2018 *)
PROG
(Magma) [(6*n+7*(-1)^n+3)/2: n in [1..80]]; // Vincenzo Librandi, Sep 13 2013
(SageMath)
def A166521(n): return 3*n -2 +7*((n+1)%2)
[A166521(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