%I #30 Mar 04 2024 01:12:37
%S 8,8,17,17,26,26,35,35,44,44,53,53,62,62,71,71,80,80,89,89,98,98,107,
%T 107,116,116,125,125,134,134,143,143,152,152,161,161,170,170,179,179,
%U 188,188,197,197,206,206,215,215,224,224,233,233,242,242,251,251,260
%N a(n) = 8 + 9*floor((n-1)/2).
%C Old definition: "a(n)=9*n-a(n-1)-2 (with a(1)=8)".
%C 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
%H Vincenzo Librandi, <a href="/A168409/b168409.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F a(n) = 9*n - a(n-1) - 2, with n>1, a(1)=8.
%F 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
%F G.f.: x*(8 + x^2)/((1+x)*(x-1)^2). - _Vincenzo Librandi_, Sep 18 2013
%F E.g.f.: (1/4)*(-9 + 4*exp(x) + (5 + 18*x)*exp(2*x))*exp(-x). - _G. C. Greubel_, Jul 21 2016
%t 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 *)
%t CoefficientList[Series[(8 + x^2)/((1 + x) (x - 1)^2), {x, 0, 70}], x] (* _Vincenzo Librandi_, Sep 18 2013 *)
%o (Magma) [8+9*Floor((n-1)/2): n in [1..70]]; // _Vincenzo Librandi_, Sep 18 2013
%o (PARI) a(n)=(n-1)\2*9 + 8 \\ _Charles R Greathouse IV_, Jul 21 2016
%Y Cf. A017257.
%K nonn,easy,less
%O 1,1
%A _Vincenzo Librandi_, Nov 25 2009
%E New definition by _Vincenzo Librandi_, Sep 18 2013