login
a(n) = (6*n + 3*(-1)^n - 3)/4.
4

%I #48 Apr 03 2024 22:11:37

%S 0,0,3,3,6,6,9,9,12,12,15,15,18,18,21,21,24,24,27,27,30,30,33,33,36,

%T 36,39,39,42,42,45,45,48,48,51,51,54,54,57,57,60,60,63,63,66,66,69,69,

%U 72,72,75,75,78,78,81,81,84,84,87,87,90,90,93,93,96,96,99,99,102,102,105,105

%N a(n) = (6*n + 3*(-1)^n - 3)/4.

%H Vincenzo Librandi, <a href="/A168237/b168237.txt">Table of n, a(n) for n = 0..1000</a> [a(0)=0 added by _Georg Fischer_, Feb 02 2021]

%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 a(n) = 3*A110654(n-1) for n >= 1.

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

%F a(n) = a(n-1) + a(n-2) - a(n-3). - _Vincenzo Librandi_, Sep 16 2013

%F E.g.f.: 3*(exp(x)*x - sinh(x))/2. - _G. C. Greubel_, Jul 16 2016

%F a(n) = 3*floor(n/2). - _Daniel Checa_, Mar 10 2024

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

%t Table[(6*n + 3*(-1)^n - 3)/4, {n,0,50}] (* or *)

%t LinearRecurrence[{1,1,-1}, {0,0,3,3}, 50] (* _G. C. Greubel_, Jul 16 2016 *)

%t With[{c=Range[0,108,3]},Riffle[c,c]] (* _Harvey P. Dale_, Feb 03 2021 *)

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

%Y Cf. A008585, A110654.

%K nonn,easy

%O 0,3

%A _Vincenzo Librandi_, Nov 21 2009

%E New definition by _R. J. Mathar_, Jan 05 2011

%E a(0)=0 added by _N. J. A. Sloane_, Feb 02 2021 at the suggestion of _Allan C. Wechsler_