[go: up one dir, main page]

login
A038707
a(n) = floor(n*(n+1/2)/2).
3
0, 0, 2, 5, 9, 13, 19, 26, 34, 42, 52, 63, 75, 87, 101, 116, 132, 148, 166, 185, 205, 225, 247, 270, 294, 318, 344, 371, 399, 427, 457, 488, 520, 552, 586, 621, 657, 693, 731, 770, 810, 850, 892, 935, 979, 1023, 1069, 1116, 1164, 1212, 1262
OFFSET
0,3
FORMULA
a(n) = (1/8) {4n^2 + 2n - 3 + (-1)^n - 2(-1)^[(n-1)/2] }. - Ralf Stephan, Jun 10 2005
a(n) = 2*a(n-1)-a(n-2)+a(n-4)-2*a(n-5)+a(n-6) with a(0)=0, a(1)=0, a(2)=2, a(3)=5, a(4)=9, a(5)=13. - Harvey P. Dale, Dec 27 2015
a(n) = floor(n*(1+2*n)/4). - Harvey P. Dale, Dec 27 2015
From Iain Fox, Dec 21 2017: (Start)
a(n) = (-3 + (-1)^n + 2*i^(n*(1 + n)) + 2*n + 4*n^2)/8, where i is the imaginary unit.
G.f.: x^2*(2 + x + x^2)/((1 - x)^3*(1 + x)*(1 + x^2)).
(End)
MATHEMATICA
Table[Floor[(n(1+2n))/4], {n, 0, 50}] (* or *) LinearRecurrence[{2, -1, 0, 1, -2, 1}, {0, 0, 2, 5, 9, 13}, 51] (* Harvey P. Dale, Dec 27 2015 *)
PROG
(PARI) a(n) = floor(n*(n+1/2)/2) \\ Iain Fox, Dec 21 2017
(PARI) a(n) = (-3 + (-1)^n + 2*I^(n*(1 + n)) + 2*n + 4*n^2)/8 \\ Iain Fox, Dec 21 2017
(PARI) first(n) = Vec(x^2*(2 + x + x^2)/((1 - x)^3*(1 + x)*(1 + x^2)) + O(x^n), -n) \\ Iain Fox, Dec 21 2017
CROSSREFS
Cf. A082643.
Sequence in context: A129726 A122489 A120615 * A290140 A109853 A071705
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 02 2000
STATUS
approved