OFFSET
1,1
COMMENTS
Old definition: "a(n)=9*n-a(n-1)-2 (with a(1)=8)".
The sequences generated by the recursive relation b(n) = h*n-b(n-1)+k, with b(1)=c and h, k, c prefixed integers, satisfy the formula b(n) = c + h*floor((n-1)/2) when 2*h+k = 2*c. - Bruno Berselli, Sep 18 2013
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) = 9*n - a(n-1) - 2, with n>1, a(1)=8.
a(1)=8, a(2)=8, a(3)=17; for n>1, a(n) = a(n-1) +a(n-2) -a(n-3). - Harvey P. Dale, Aug 18 2013
G.f.: x*(8 + x^2)/((1+x)*(x-1)^2). - Vincenzo Librandi, Sep 18 2013
E.g.f.: (1/4)*(-9 + 4*exp(x) + (5 + 18*x)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 21 2016
MATHEMATICA
RecurrenceTable[{a[1]==8, a[n]==9n-a[n-1]-2}, a, {n, 60}] (* or *) LinearRecurrence[{1, 1, -1}, {8, 8, 17}, 80] (* or *) With[{c = LinearRecurrence[{2, -1}, {8, 17}, 30]}, Riffle[c, c]] (* Harvey P. Dale, Aug 18 2013 *)
CoefficientList[Series[(8 + x^2)/((1 + x) (x - 1)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Sep 18 2013 *)
PROG
(Magma) [8+9*Floor((n-1)/2): n in [1..70]]; // Vincenzo Librandi, Sep 18 2013
(PARI) a(n)=(n-1)\2*9 + 8 \\ Charles R Greathouse IV, Jul 21 2016
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Vincenzo Librandi, Nov 25 2009
EXTENSIONS
New definition by Vincenzo Librandi, Sep 18 2013
STATUS
approved