OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (3,-4,4,-3,1).
FORMULA
a(n) = (3*n^2 - 3*n + cos(n*Pi/2) + sin(n*Pi/2) - 1)/2.
a(n) = A268428(n) - 149.
a(n) = (1/4+i/4)*((i-1)+(-i)^n-i*i^n-(-3*i+3)*n+(-3*i+3)*n^2), where i is the imaginary unit.
a(n) = (3*n^2 - 3*n + (-1)^binomial(n+1,2) - 1)/2.
G.f.: (2*(x^3 + x^2 + x)/((1 - x)^3*(x^2 + 1))).
MATHEMATICA
Table[2 Floor[3 n (n + 1)/4], {n, 0, 60}]
LinearRecurrence[{3, -4, 4, -3, 1}, {0, 2, 8, 18, 30}, 60]
PROG
(Magma) [2*Floor(3*n*(n+1)/4): n in [0..60]]; // Vincenzo Librandi, Feb 15 2016
(PARI) vector(60, n, n--; 2*floor(3*n*(n+1)/4)) \\ G. C. Greubel, Nov 04 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Feb 13 2016
STATUS
approved