Calculation sum of odd\even less than a 100.

<p>There are many ways to solve this.</p>

<p>Perhaps the simplest is to look at the question as an arithmetic sequence.
For odd numbers:
(remember an = a1 + (n-1)d)
a1 (first term) = 1
an (last term n) = 99
d (difference) = 2</p>

<p>Solve for n.
99 = 1 + (n-1)2
You get: n (number of terms) = 50</p>

<p>Sum of arithmetic sequence: Sumn = ((a1+an)/2)*n</p>

<p>Plug in: Sum50 = ((1+99)/2)*50
Sum50 = 2500</p>

<p>Same concept for even numbers.</p>

<p>Different method, solving for even numbers this time:
2,4,6....94,96,98,100</p>

<p>You may notice that the sum of numbers at the beginning of the sequence and the end of it, remains unchanged for equally distanced numbers from each side.</p>

<p>So: 102 = 2+100 = 4 + 98 = 6 + 96 ..etc.</p>

<p>You have 50 even numbers, or 25 pairs that each equals 102.
Multiply: 102 * 25 = 2550. and Voila.</p>

<p>Edit: Fixed a careless mistake on the 2nd solution!</p>

<p>Hi all.</p>

<p>I am looking for a way to calculate sum of 100 (or even more) odd or even numbers.</p>

<p>Lets say that I want to calculate all the even numbers from 0 to 100 and all the odd from 0 to 100. Is there a formula I can use, or some way to type it in my calculator and get the result?</p>

<p>Thank you.</p>

<p>Thank you.</p>

<p>This forum is amazing!!! Again thank you so much guys.</p>

<p>Clearly, this works for numbers greater than 100, so the “less than 100” condition can be dropped.</p>

<p>Also, note that</p>

<p>1 + 3 + 5 + … + (2n-1) = n^2 (this can be proven by induction or by “Gauss’s trick” which you referenced in the original post).</p>

<p>So 1 + 3 + 5 + … + 99 = 50^2 = 2500.</p>