- #1
Why?
- 6
- 0
Homework Statement
The alternating sum of the first five numbers is 1-2+3-4+5=3. Find a formula for the alternating sum of the first n numbers. How about the alternating sum of the squares of the first n numbers?
Homework Equations
Sum of the first n numbers. [itex]\frac{n(n+1)}{2}[/itex]
Sum of the first n even numbers. n(n+1)
Sum of the first n odd numbers. n2
The Attempt at a Solution
Sum of the first n alternating numbers if n is odd. [itex]{(\frac{n+1}{2}})^{2}-(\frac{n-1}{2})({\frac{n-1}{2}+1})[/itex]
Sum of the first n alternating numbers if n is even. [itex]{(\frac{n}{2}})^{2}-(\frac{n}{2})({\frac{n}{2}+1})[/itex]
I cannot figure out how to combine these two equations into one that will work for both odd and even n. I have not even begun the second part of the problem.