neerajeai wrote:For any positive integer n, the sum of the first n positive integers equals n(n+1)/2.
What is the sum of all the ODD integers between 99 and 301?
A) 10100
B) 20200
C) 20402
D) 40200
E) 45150
OA will be posted in next 1 hour. Looking for the most efficient way of doing this.
There's a formula for finding these kinds of sum (aka arithmetic series), but I'm not a fan of most formulas (although some are worthwhile). Plus my solution still contains many of the elements found in the formula approach.
Both approaches require us to determine how many numbers we're adding together, so let's begin with this task.
How many numbers are in the set {101, 103, 105, . . . 297, 299}?
To answer this question, consider this easier question: How many numbers are in the set {100,
101, 102,
103, 104,
105, . . . 296,
297, 298,
299}?
Notice that for every
odd number, we have an even number. So, half of the numbers are odd.
Here's a need-to-know (easy to memorize) formula:
In the set of integers from x to y inclusive, the number of values = y-x+1
So, in the set of integers from 100 to 299 inclusive, the number of values = 299-100+1 = 200
There are 200 numbers from 100 to 299 inclusive.
If half of them are odd, then
100 numbers are odd.
That's the hard part. Now let's find the sum.
We want 101+103+105+....297+299
To find this sum, let's add values in
pairs, beginning from the outside and working in:
(101+299) + (103+297) + (105+295) + (107+293) + . .
IMPORTANT: each pair of values adds to 400.
How many 400's are we adding together?
Well, if there are
100 odd numbers altogether, then there are 50 pairs of values.
So, we get 50(400)=
20,000
Cheers,
Brent