login
A119518
Abs(*+-) n Sequence.
0
1, 2, 5, 1, 15, 9, 16, 65, 56, 66, 166, 154, 167, 336, 321, 337, 593, 575, 594, 955, 934, 956, 1440, 1416, 1441, 2066, 2039, 2067, 2851, 2821, 2852, 3813, 3780, 3814, 4970, 4934, 4971, 6340, 6301, 6341, 7941, 7899, 7942, 9791, 9746, 9792, 11908, 11860
OFFSET
1,2
FORMULA
ABS(1+2*3-4+...+(n-2)*(n-1)-n)
a(3*s) = abs[4 + 3*A000217(s) - 2*s - 9*A000217(s - 1) - 9*A000330(s - 1)] = abs[4 + 5s/2 + 3s^2/2 - 3s^3], s = 1, 2, 3... a(3*s - 1) = abs[4 + 3*A000217(s) - 5*s - 9*A000217(s - 1) - 9*A000330(s - 1)] = abs[4 - s/2 + 3s^2/2 - 3s^3], s = 1, 2, 3.. - R. J. Mathar, Jan 25 2007
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
Sequence in context: A260665 A110220 A349106 * A216962 A186756 A184940
KEYWORD
nonn
AUTHOR
Jorge Coveiro, Jul 27 2006
EXTENSIONS
Corrected and extended by Zak Seidov, Jul 30 2006
STATUS
approved