We were asked to write a program that inputs an integer n>=1, then compute and output the alternating sum with the formula:
\ j - 1 2 n - 1 2
/__ ( -1) j = 1 - 4 + 9 - 16 + ... + (-1) n .
j = 1
For example: for n = 4, the output would be -10 because 1 - 4 + 9 - 16 = -10.
I am not asking anybody to write me a program, I just need help understanding this formula. I don't get how the formula works. Substituting the values, I didn't get the same answer. I am probably in the wrong forum but I was just hoping somebody here knows ??:confused:
Very sorry for the sloppy summation sign. I don't have the equation command installed in my editor..
Thanks... any help will be great!!!