%I #31 Feb 25 2023 05:23:55
%S 2,0,4,2,6,4,8,6,10,8,12,10,14,12,16,14,18,16,20,18,22,20,24,22,26,24,
%T 28,26,30,28,32,30,34,32,36,34,38,36,40,38,42,40,44,42,46,44,48,46,50,
%U 48,52,50,54,52,56,54,58,56,60,58,62,60,64,62,66,64,68,66,70,68,72
%N a(n) = (2*n - 3*(-1)^n - 1)/2.
%H Vincenzo Librandi, <a href="/A168232/b168232.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 From _R. J. Mathar_, Jan 05 2011: (Start)
%F G.f.: 2*x*(1 - x + x^2) / ( (1+x)*(x-1)^2 ).
%F a(n) = 2*A028242(n-1). (End)
%F a(n) = a(n*1) +a(n-2) -a(n-3). - _Vincenzo Librandi_, Sep 15 2013
%F a(n) = ceiling((n+1)/2) + floor((n+2)/2) - 4*mod(n+1,2). - _Wesley Ivan Hurt_, Aug 20 2014
%F E.g.f.: (1/2)*(-3 + 4*exp(x) + (2*x - 1)*exp(2*x))*exp(-x). - _G. C. Greubel_, Jul 16 2016
%F Sum_{n>=3} (-1)^n/a(n) = 1/2. - _Amiram Eldar_, Feb 25 2023
%p A168232:=n->n-1/2-3*(-1)^n/2: seq(A168232(n), n=1..100); # _Wesley Ivan Hurt_, Aug 20 2014
%t CoefficientList[Series[2 (1 + x^2 - x)/((1 + x) (x - 1)^2), {x, 0, 100}], x] (* _Vincenzo Librandi_, Sep 16 2013 *)
%t LinearRecurrence[{1,1,-1}, {2, 0, 4}, 50] (* _G. C. Greubel_, Jul 16 2016 *)
%o (Magma) [n-1/2-3*(-1)^n/2: n in [1..60]]; // _Vincenzo Librandi_, Sep 16 2013
%o (PARI) vector(80, n, n - 1/2 - 3*(-1)^n/2) \\ _Michel Marcus_, Aug 21 2014
%Y Cf. A028242.
%K nonn,easy
%O 1,1
%A _Vincenzo Librandi_, Nov 21 2009
%E New definition by _R. J. Mathar_, Jan 05 2011