login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = 4*n - 2*(-1)^n.
2

%I #30 Mar 19 2024 09:33:34

%S 6,6,14,14,22,22,30,30,38,38,46,46,54,54,62,62,70,70,78,78,86,86,94,

%T 94,102,102,110,110,118,118,126,126,134,134,142,142,150,150,158,158,

%U 166,166,174,174,182,182,190,190,198,198,206,206,214,214,222,222,230,230

%N a(n) = 4*n - 2*(-1)^n.

%H Vincenzo Librandi, <a href="/A168384/b168384.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) = 8*n - a(n-1) - 4, with n>1, a(1)=6.

%F From _Vincenzo Librandi_, Sep 18 2013: (Start)

%F G.f.: 2*x*(3 + x^2)/((1+x)*(x-1)^2).

%F a(n) = a(n-1) + a(n-2) - a(n-3).

%F a(n) = 6 + 8*floor((n-1)/2). (End)

%F E.g.f.: 2*(-1 + exp(x) + 2*x*exp(2*x))*exp(-x). - _G. C. Greubel_, Jul 19 2016

%t CoefficientList[Series[(6 + 2 x^2)/((1 + x) (x - 1)^2), {x, 0, 70}], x] (* _Vincenzo Librandi_, Sep 18 2013 *)

%t LinearRecurrence[{1,1,-1},{6,6,14},70] (* _Harvey P. Dale_, Mar 14 2023 *)

%o (Magma) [4*n -2*(-1)^n: n in [1..70]]; // _Vincenzo Librandi_, Sep 18 2013

%o (Magma) [6+8*Floor((n-1)/2): n in [1..70]]; // _Vincenzo Librandi_, Sep 18 2013

%Y Cf. A296910.

%K nonn,easy

%O 1,1

%A _Vincenzo Librandi_, Nov 24 2009

%E Definition rewritten by _Vincenzo Librandi_, Sep 18 2013