OFFSET
1,1
COMMENTS
Also, integer values of (n*(n+1)+1)/7. - Bruno Berselli, Jan 25 2013
LINKS
David Lovler, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
From R. J. Mathar, Dec 16 2009: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
G.f.: x*(2+2*x+3*x^2)/((1+x)*(x-1)^2). (End)
a(n) = 7*floor((n-1)/2) + 3 + (-1)^n. - Gary Detlefs, Mar 02 2010
a(n) = 7*n - a(n-1) - 8 with n > 1, a(1)=2. - Vincenzo Librandi, Aug 05 2010
E.g.f.: 3 + ((14*x - 9)*exp(x) - 3*exp(-x))/4. - David Lovler, Sep 12 2022
MAPLE
seq(7*floor((n-1)/2)+3 +(-1)^n, n=1..49); # Gary Detlefs, Mar 02 2010
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {2, 4, 9}, 50] (* Harvey P. Dale, Aug 04 2016 *)
PROG
(PARI) a(n) = (14*n - 9 - 3*(-1)^n)/4 \\ David Lovler, Sep 18 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved