OFFSET
1,1
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = 8*n-a(n-1)-4 (with a(1)=5). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n-(-1)^n. - Rolf Pleisch, Nov 02 2010
a(1)=5, a(2)=7, a(3)=13; for n>3, a(n) = a(n-1)+a(n-2)-a(n-3). - Harvey P. Dale, Jun 04 2012
G.f.: x*(5+2*x+x^2) / ((1-x)^2*(1+x)). - Colin Barker, Aug 26 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 - sqrt(2)*log(sqrt(2)+1)/4. - Amiram Eldar, Dec 19 2021
E.g.f.: 1 + 4*x*exp(x) - exp(-x). - David Lovler, Sep 02 2022
MAPLE
MATHEMATICA
With[{r8=8*Range[0, 40]}, Sort[Join[r8+5, r8+7]]] (* or *) LinearRecurrence[ {1, 1, -1}, {5, 7, 13}, 80] (* Harvey P. Dale, Jun 04 2012 *)
Table[4 n - (-1)^n, {n, 100}] (* Wesley Ivan Hurt, Mar 31 2014 *)
PROG
(PARI) Vec(x*(5+2*x+x^2)/((1-x)^2*(1+x)) + O(x^100)) \\ Colin Barker, Aug 26 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Vincenzo Librandi, Aug 06 2010
STATUS
approved