OFFSET
1,2
FORMULA
ABS(1+2*3-4+...+(n-2)*(n-1)-n)
EXAMPLE
a(1)=1
a(2)=1*2
a(3)=1*2+3
a(4)=1*2+3-4
a(5)=1*2+3-4*5
a(6)=1*2+3-4*5+6
a(7)=1*2+3-4*5+6-7
a(8)=1*2+3-4*5+6-7*8
MATHEMATICA
s={1, 2}; b=2; Do[b=b+Switch[Mod[n, 3], 0, Plus[n], 1, -n, 2, -(n-1)^2]; AppendTo[s, Abs[b]], {n, 3, 50}]; s - Zak Seidov, Jul 30 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Jorge Coveiro, Jul 27 2006
EXTENSIONS
Corrected and extended by Zak Seidov, Jul 30 2006
STATUS
approved