|
Search: id:A064520
|
|
|
| A064520 |
|
a(n) = + 1 - 2 - 3 + 4 + 5 + 6 - 7 - 8 - 9 - 10 + 11 + 12 + 13 + 14 + 15 - ... + (+-1)*n, where there is one plus, two minuses, three pluses, etc. (see A002024). |
|
+0 2
|
|
| 1, -1, -4, 0, 5, 11, 4, -4, -13, -23, -12, 0, 13, 27, 42, 26, 9, -9, -28, -48, -69, -47, -24, 0, 25, 51, 78, 106, 77, 47, 16, -16, -49, -83, -118, -154, -117, -79, -40, 0, 41, 83, 126, 170, 215, 169, 122, 74, 25, -25, -76, -128, -181, -235, -290, -234, -177, -119, -60, 0, 61, 123, 186, 250, 315, 381, 314, 246, 177
(list; graph; listen)
|
|
|
OFFSET
|
1,3
|
|
|
COMMENT
|
|a(n)| takes its locally maximal values when n is a triangular number, the maximal values being given by A019298.
The maximal positive / negative values occur for the n = 1,3,6,10,15,21 ..the triangular numbers and are a(n) = 1, -4, 11, -23, 42, -69,106, 215, 381, 616 .. +/- int(sqrt(n^3/2) + 0.22098 * sqrt(n)) a(n) = n for n = 5,13, 25, 41, 61, 85, .. m*(m*2-2)+1 and the previous number is equal to 0 Positive numbers which do not occur in this sequence are 2,3,6,7,8,10,12,14,15, 17,18,19,20,21,22,23,24,28,29,30,31,32,33,34,35,37,38,39,40,43,44,45,46,48
|
|
LINKS
|
Harry J. Smith, Table of n, a(n) for n=1,...,1000
|
|
FORMULA
|
a(n) = Sum_{k=1..n} (-1)^(A002024(k)+1)*k.
|
|
EXAMPLE
|
a(9) = -13 because 1 - 2 - 3 + 4 + 5 + 6 - 7 - 8 - 9 = -13
|
|
MAPLE
|
a := proc(n) option remember: if n=1 then RETURN(1) fi: a(n-1) + n*(-1)^( floor(1/2 + sqrt(2*n)+1)); end: for n from 1 to 150 do printf(`%d, `, a(n)) od:
|
|
PROGRAM
|
(PARI) t(n) = floor(1/2+sqrt(2*n)) for(n=1, 200, print1(sum(k=1, n, (-1)^(t(k)+1)*k), " "))
(PARI) t(n)= { floor(sqrt(2*n) + 1/2) } { for (n=1, 1000, a=sum(k=1, n, (-1)^(t(k) + 1)*k); write("b064520.txt", n, " ", a) ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Sep 17 2009]
|
|
CROSSREFS
|
Cf. A064528.
Sequence in context: A102293 A021965 A164108 this_sequence A108174 A134530 A126813
Adjacent sequences: A064517 A064518 A064519 this_sequence A064521 A064522 A064523
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 07 2001
|
|
EXTENSIONS
|
More terms from James A. Sellers (sellersj(AT)math.psu.edu), Jason Earls (zevi_35711(AT)yahoo.com) and Vladeta Jovovic (vladeta(AT)eunet.rs), Oct 08 2001
|
|
|
Search completed in 0.002 seconds
|