login
A110345
a(n) = n + (n+1) + (n+2) + ... n terms if n is odd, else a(n) = n + (n-1) + (n-2) + ... n terms = n(n+1)/2 = n-th triangular number if n is even.
0
1, 3, 12, 10, 35, 21, 70, 36, 117, 55, 176, 78, 247, 105, 330, 136, 425, 171, 532, 210, 651, 253, 782, 300, 925, 351, 1080, 406, 1247, 465, 1426, 528, 1617, 595, 1820, 666, 2035, 741, 2262, 820, 2501, 903, 2752, 990, 3015, 1081, 3290, 1176, 3577, 1275, 3876, 1378
OFFSET
1,2
FORMULA
a(2n) = n*(2n+1), a(2n-1) = (2n-1)*(n-1)+(2n-1)^2. - Stefan Steinerberger, Jan 24 2006
From Bruno Berselli, Mar 19 2012: (Start)
G.f.: x*(1+3x+9x^2+x^3+2x^4)/(1-x^2)^3.
a(n) = n^2-(-1)^n*(n-1)*n/2. (End)
Sum_{n>=1} 1/a(n) = 2 + Pi/(2*sqrt(3)) + log(3*sqrt(3)/16). - Amiram Eldar, Sep 11 2022
EXAMPLE
a(3) = 3+4+5 = 12.
a(6) = 6+5+4+3+2+1 = 21.
MATHEMATICA
For[n = 1, n < 50, n++, If[EvenQ[n], Print[n*(n + 1)/2], Print[n^2 + n*(n - 1)/2]]] (* Stefan Steinerberger, Jan 24 2006 *)
CROSSREFS
Sequence in context: A292581 A207852 A182455 * A018999 A279305 A217785
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Jul 20 2005
EXTENSIONS
More terms from Stefan Steinerberger, Jan 24 2006
STATUS
approved