# Thread: Calculations and cycle times 30,000

1. I'm having trouble with my CS work. This is my question.

Q1: Using the FORMULA from the background section, what is the sum of the first 30,000 whole numbers, and show the specific formula that you use to calculate the sum.

(i.e. 1 + 2 + 3 + · · · + 29,998 + 29,999 + 30,000)

I thought it was 450015000 but I wasn't sure. I use the formula. n^2(n+1)/2

I don't want the answer or you to do my work, but I would like some help.  2.

I could give you the correct formula, and you would apply it and get the correct result, but it is more interesting to understand what is going on.

Try thinking about it this way:

The first plus last number in your series add up to 1+30,000=30,001.
The second and the last but one number add up to 2+29,999=30,001.
The third and the last but two ... = 3+29,998=30,001.

If you look carefully, there is a pattern. Yes, taking one number at a time from the beginning, and another from the end of your series, you get pairs that always sum to 30,001, that is, N+1.

Now how many such pair have you got?

Obviously, N numbers mean N/2 pairs.

Getting the idea? Can you now find the formula by yourself?

Now you may wonder what if N is odd, so after forming a lot of pairs you will be left with one single number and nothing to pair it with.

Never mind, that remaining number will be the middle element of the series, so it will be equal (1+N)/2, and will be exactly "half a pair".

Good luck, and keep us posted. Feel free to ask more questions.  4. So close - just remove the ^2 from your formula and try again....  5. Ok so the answer would be 450001500, but I am still having trouble trying to figure out exactly what this means. Which sorting method is this? We are calculating cycles per second correct? Or is this just calculating each cycle pass without the element of time. Thanks for the help btw.  6. Originally Posted by Goddard
Which sorting method is this? We are calculating cycles per second correct?
So far, we have been adding integer numbers. I don't know how this relates to any sorting method or cycles per second.  Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement