login
A110349
a(n) = n + (n+1) + (n-1) + (n+2) + (n-2) ... n terms.
1
1, 5, 9, 18, 25, 39, 49, 68, 81, 105, 121, 150, 169, 203, 225, 264, 289, 333, 361, 410, 441, 495, 529, 588, 625, 689, 729, 798, 841, 915, 961, 1040, 1089, 1173, 1225, 1314, 1369, 1463, 1521, 1620, 1681, 1785, 1849, 1958, 2025, 2139, 2209, 2328, 2401, 2525
OFFSET
1,2
FORMULA
a(2n-1) = (2n-1)^2; a(2n)=4n^2+n. - Emeric Deutsch, Aug 03 2005
G.f.: x*(1+4*x+2*x^2+x^3)/((1+x)^2*(1-x)^3). - Bruno Berselli, Mar 19 2012
a(n) = n(4n+(-1)^n+1)/4. - Bruno Berselli, Mar 19 2012
EXAMPLE
a(4) = 4+5+3+6 = 18.
a(5) = 5+6+4+7+3 = 25.
MAPLE
a:=proc(n) if n mod 2 = 0 then n^2+n/2 else n^2 fi end: seq(a(n), n=1..60); # Emeric Deutsch, Aug 03 2005
MATHEMATICA
f[n_]:=If[OddQ[n], n^2, n/2*(2n+1)]; Array[f, 50] (* Harvey P. Dale, Mar 17 2012 *)
CROSSREFS
Sequence in context: A315119 A372709 A061502 * A036832 A257595 A116453
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Jul 21 2005
EXTENSIONS
More terms from Emeric Deutsch, Aug 03 2005
STATUS
approved