Sum of Integers

This topic has expert replies
Master | Next Rank: 500 Posts
Posts: 112
Joined: Wed Jan 20, 2010 5:46 am
Thanked: 1 times

Sum of Integers

by Thouraya » Tue Mar 01, 2011 7:20 am
Does this always hold true?


n(n+1) /2 is for the sum of first n integers. ( 1 + 2 + 3+ .... + n)

The sum of first n EVEN integers is TWICE that. ( 2 + 4 + 6 +... + 2n) = 2 * ( 1+ 2 + 3 +...+n) = 2* n(n+1)/2 = n*(n+1)

So what would the sum of the first n ODD integers be? Divide by 2?

Thank you!
Source: — Problem Solving |

User avatar
GMAT Instructor
Posts: 147
Joined: Tue Aug 25, 2009 7:57 pm
Location: New York City
Thanked: 76 times
Followed by:17 members
GMAT Score:770

by Rich@VeritasPrep » Tue Mar 01, 2011 8:36 am
Hey Thouraya,

Let's take a quick look at the sum of first n odd integers and the sum of the first n even integers:

1+3+5+7+...+(2n-1)

2+4+6+8+...+2n

Notice that every term in the first series is 1 fewer than the corresponding term in the second. In fact, you can re-write the first series as follows:

1+3+5+7+...+(2n-1)

= (2-1) + (4-1) + (6-1) + (8-1) + ... (2n-1)

There are n terms total, which means we are subtracting 1 a total of n times. That means we're essentially subtracting n from the sum of the first n even terms:

(2-1) + (4-1) + (6-1) + (8-1) + ... (2n-1)

= (2+4+6+8+...+2n) - n

You found out that the parenthetical can be simplified to n*(n+1), so substitute:

(2+4+6+8+...+2n) - n

= n*(n+1) - n

= n^2 + n - n

= n^2

You could also observe this by looking at individual sums:

1 = 1^2
1+3 = 4 = 2^2
1+3+5 = 9 = 3^2
1+3+5+7 = 16 = 4^2
...
1+3+5+7+...+2n-1 = n^2

Hope that helps![/b]
Rich Zwelling
GMAT Instructor, Veritas Prep

User avatar
GMAT Instructor
Posts: 15539
Joined: Tue May 25, 2010 12:04 pm
Location: New York, NY
Thanked: 13060 times
Followed by:1906 members
GMAT Score:790

by GMATGuruNY » Tue Mar 01, 2011 9:09 am
Thouraya wrote:Does this always hold true?


n(n+1) /2 is for the sum of first n integers. ( 1 + 2 + 3+ .... + n)

The sum of first n EVEN integers is TWICE that. ( 2 + 4 + 6 +... + 2n) = 2 * ( 1+ 2 + 3 +...+n) = 2* n(n+1)/2 = n*(n+1)

So what would the sum of the first n ODD integers be? Divide by 2?

Thank you!
To determine the sum of evenly spaced integers, I find it easiest to use the following formula:

Sum = (number of integers) * (average of biggest and smallest)

To count the number of evenly spaced integers in a set:

Number of integers = (Biggest - Smallest)/(distance between each successive pair) + 1

Thus, given the even integers from 2 to 100, inclusive:

Number of integers = (100-2)/2 + 1 = 50.
Average of biggest and smallest = (100+2)/2 = 51.
Sum = 50*51 = 2550.

Given the odd integers from 1 to 99, inclusive:

Number of integers = (99-1)/2 + 1 = 50.
Average of biggest and smallest = (99+1)/2 = 50.
Sum = 50*50 = 2500.
Private tutor exclusively for the GMAT and GRE, with over 20 years of experience.
Followed here and elsewhere by over 1900 test-takers.
I have worked with students based in the US, Australia, Taiwan, China, Tajikistan, Kuwait, Saudi Arabia -- a long list of countries.
My students have been admitted to HBS, CBS, Tuck, Yale, Stern, Fuqua -- a long list of top programs.

As a tutor, I don't simply teach you how I would approach problems.
I unlock the best way for YOU to solve problems.

For more information, please email me (Mitch Hunt) at [email protected].
Student Review #1
Student Review #2
Student Review #3

Master | Next Rank: 500 Posts
Posts: 112
Joined: Wed Jan 20, 2010 5:46 am
Thanked: 1 times

by Thouraya » Tue Mar 01, 2011 9:20 am
Very clear indeed, Mitch!

How about if I want the sum of integers? (in general, not even or odd)

Thank you!!You just made my life easier:)

User avatar
GMAT Instructor
Posts: 15539
Joined: Tue May 25, 2010 12:04 pm
Location: New York, NY
Thanked: 13060 times
Followed by:1906 members
GMAT Score:790

by GMATGuruNY » Tue Mar 01, 2011 9:51 am
Thouraya wrote:Very clear indeed, Mitch!

How about if I want the sum of integers? (in general, not even or odd)

Thank you!!You just made my life easier:)
Use the same formula. With consecutive integers, the distance between each successive pair is 1.

Given the integers 100-200:
Number of integers = (200-100)/1 + 1 = 101.
Average of biggest and smallest = (200+100)/2 = 150.
Sum = 101*150 = 15150.
Private tutor exclusively for the GMAT and GRE, with over 20 years of experience.
Followed here and elsewhere by over 1900 test-takers.
I have worked with students based in the US, Australia, Taiwan, China, Tajikistan, Kuwait, Saudi Arabia -- a long list of countries.
My students have been admitted to HBS, CBS, Tuck, Yale, Stern, Fuqua -- a long list of top programs.

As a tutor, I don't simply teach you how I would approach problems.
I unlock the best way for YOU to solve problems.

For more information, please email me (Mitch Hunt) at [email protected].
Student Review #1
Student Review #2
Student Review #3

Master | Next Rank: 500 Posts
Posts: 112
Joined: Wed Jan 20, 2010 5:46 am
Thanked: 1 times

by Thouraya » Wed Mar 02, 2011 12:24 am
Mitch,

1)How about if I don't have the value of the last integer? Then I can't use the formula above (sum=num of integers * average). Ex: The infinite sequence a1, a2,�, an,� is such that a1 = 2, a2 = -3, a3 = 5, a4 = -1, and a_n = a_n-4 for n > 4. What is the sum of the first 97 terms
of the sequence?


Also, why is this not working?

2)The sum of all the digits of the integers from 18 to 21 inclusive is 24 (1+8 + 1+9 + 2+0 + 2+1 = 24). What is the sum of all the digits of the integers from 0 to 99 inclusive?

Number of integers: 99
Average: 99/2=49.5
Sum=99*49.5=4900.5 WHILE THE CORRECT ANSWER IS 900

3)Is this correct?

What is the sum of all possible 3-digit numbers that can be constructed using the digits 3,4,5, if each digit can be used only once in each number?

Here's how I solved it:

Number of integers: 543-345/1+1=199
Average: 345+543/2=444
Sum= 444*199=88,356



I really hope to hear back from you..Thanks a million!

User avatar
GMAT Instructor
Posts: 15539
Joined: Tue May 25, 2010 12:04 pm
Location: New York, NY
Thanked: 13060 times
Followed by:1906 members
GMAT Score:790

by GMATGuruNY » Wed Mar 02, 2011 7:42 am
How about if I don't have the value of the last integer? Then I can't use the formula above (sum=num of integers * average). Ex: The infinite sequence a1, a2,�, an,� is such that a1 = 2, a2 = -3, a3 = 5, a4 = -1, and a_n = a_n-4 for n > 4. What is the sum of the first 97 terms of the sequence?
The numbers in the sequence are not evenly spaced, so the formula given in my original post is not applicable.

Step 1: Determine the pattern.
Since a_n = a(n-4):
a5 = a_(5-4) = a1
a6 = a_(6-4) = a2
a7 = a_(7-4) = a3
a8 = a_(8-4) = a4

Now we can see that a5, a6, a7, a8 = a1, a2, a3, a4, indicating that the series repeats in a pattern of 4:
2, -3, 5, -1, 2, -3, 5, -1, 2, -3, 5, -1...

Step 2: Determine the sum of each repetition of the pattern.
The sum of each repetition = 2 + -3 + 5 + -1 = 3.

Step 3: Determine how many times the pattern will repeat.
24*4 = 96, so the pattern will repeat 24 times, yielding a sum of 24*3 = 72.

Step 4: Add in the remaining terms.
The 97th term = 2. Adding in this term, we get a total sum of 72+2 = 74.
2)The sum of all the digits of the integers from 18 to 21 inclusive is 24 (1+8 + 1+9 + 2+0 + 2+1 = 24). What is the sum of all the digits of the integers from 0 to 99 inclusive?

Number of integers: 99
Average: 99/2=49.5
Sum=99*49.5=4900.5 WHILE THE CORRECT ANSWER IS 900
The question asks not for the sum of the integers but for the sum of the digits, so the formula given in my original post is not applicable.

Step 1: Determine how many times each digit will appear.
Let's start with the digit 1.
In the tens place, the digit 1 will appear in every integer from 10-19, giving us 10 appearances.
In the units place, the digit 1 will appear in 1, 11, 21...91, giving us another 10 appearances.
Thus, the digit 1 will appear 10+10 = 20 times.
Using the same logic, we can see that each of the other digits 2-9 also will appear 20 times.

Step 2: Multiply each digit by the number of times it will appear.
Since each digit is appearing the same number of times, we should first use the formula in my original post to determine the sum of the digits 1 to 9:
Number of integers = (9-1)/1 + 1 = 9.
Average of biggest and smallest = (9+1)/2 = 5.
Sum = 9*5 = 45.

Since each digit appears 20 times:
Sum of all the digits = 20*45 = 900.
Private tutor exclusively for the GMAT and GRE, with over 20 years of experience.
Followed here and elsewhere by over 1900 test-takers.
I have worked with students based in the US, Australia, Taiwan, China, Tajikistan, Kuwait, Saudi Arabia -- a long list of countries.
My students have been admitted to HBS, CBS, Tuck, Yale, Stern, Fuqua -- a long list of top programs.

As a tutor, I don't simply teach you how I would approach problems.
I unlock the best way for YOU to solve problems.

For more information, please email me (Mitch Hunt) at [email protected].
Student Review #1
Student Review #2
Student Review #3

Master | Next Rank: 500 Posts
Posts: 112
Joined: Wed Jan 20, 2010 5:46 am
Thanked: 1 times

by Thouraya » Thu Mar 03, 2011 1:01 am
Amazing approaches!!!