OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1100
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = (6*n + 5 - 5*(-1)^n)/4. - Jon E. Schoenfield, Jun 24 2010
From Joerg Arndt, Apr 24 2011: (Start)
a(n) = +1*a(n-1) + 1*a(n-2) - 1*a(n-3).
G.f.: x*(4-x)/(1-x-x^2+x^3) = x*(4-x)/((1+x)*(1-x)^2). (End)
a(n) = floor(3*(n+1)/2)-(-1)^n. - Wesley Ivan Hurt, Sep 12 2017
Sum_{n>=1} (-1)^n/a(n) = 1 - Pi/(6*sqrt(3)) - log(3)/2. - Amiram Eldar, Feb 23 2023
MATHEMATICA
RecurrenceTable[{a[1]==4, a[n]==3n-a[n-1]+1}, a, {n, 70}] (* or *) LinearRecurrence[{1, 1, -1}, {4, 3, 7}, 80] (* Harvey P. Dale, Jul 31 2014 *)
PROG
(Magma) [(6*n+5-5*(-1)^n)/4: n in [1..70]];
(PARI) a(n)=(6*n+5-5*(-1)^n)/4 \\ Charles R Greathouse IV, Jan 11 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 20 2009
STATUS
approved