login
A124093
Triangular numbers alternating with squares.
3
0, 0, 1, 1, 3, 4, 6, 9, 10, 16, 15, 25, 21, 36, 28, 49, 36, 64, 45, 81, 55, 100, 66, 121, 78, 144, 91, 169, 105, 196, 120, 225, 136, 256, 153, 289, 171, 324, 190, 361, 210, 400, 231, 441, 253, 484, 276, 529, 300, 576, 325, 625, 351, 676, 378, 729, 406, 784, 435, 841
OFFSET
0,5
FORMULA
a(n) = n(n+2)/8 if n is even; a(n) = (n-1)^2/4 if n is odd (n>=0). - Emeric Deutsch, Nov 29 2006
a(n) = (3*n^2-2*n+2-(n^2-6*n+2)*(-1)^n)/16. - Luce ETIENNE, May 28 2015
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6) for n>5. - Colin Barker, May 28 2015
G.f.: -x^2*(x^3+x+1) / ((x-1)^3*(x+1)^3). - Colin Barker, May 28 2015
MAPLE
a:=proc(n) if n mod 2 = 0 then n*(n+2)/8 else (n-1)^2/4 fi end: seq(a(n), n=0..70); # Emeric Deutsch, Nov 29 2006
MATHEMATICA
tr=Table[{k(k+1)/2, k^2}, {k, 0, 100}]//Flatten (Seidov)
With[{nn=30}, Riffle[Accumulate[Range[0, nn]], Range[0, nn]^2]] (* Harvey P. Dale, Jul 13 2014 *)
PROG
(PARI) concat([0, 0], Vec(-x^2*(x^3+x+1)/((x-1)^3*(x+1)^3) + O(x^100))) \\ Colin Barker, May 28 2015
CROSSREFS
Cf. A123596. Rearrangement of A054686.
Sequence in context: A054686 A005214 A268110 * A025061 A284741 A342577
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a suggestion from Robert G. Wilson v, Nov 27 2006
EXTENSIONS
More terms from Zak Seidov, Nov 28 2006
More terms from Emeric Deutsch, Nov 29 2006
STATUS
approved