Scientific American presents Math Dude by Quick & Dirty Tips. Scientific American and Quick & Dirty Tips are both Macmillan companies.

In the last episode, we learned an amazing trick that you can use to quickly add up all the integers from 1 to 100. And that really was no small feat since we turned the herculean task of performing 100 addition problems—that is adding up 1 + 2 + 3 + 4 + … + 100—into a cute fuzzy kitten of a single multiplication problem. Although this trick is undeniably impressive, it’s not exactly the kind of thing you can pull out at parties to impress your friends since they could claim that you simply memorized the answer.

Which might lead you to wonder: Instead of just adding up the first 100 positive integers, is there a way to quickly calculate the sum of the first 50, 200, or maybe even 1,000 positive integers? In other words, is there a way to quickly calculate the sum of all the integers from 1 up to any other number—which we’ll call “n”—that your friends might throw at you? That would be a rather impressive trick, right? Well, as luck would have it, there is a way to do it…and that’s exactly what we’re going to talk about today.

Recap: Adding the Integers From 1 to 100
Before we figure out how to add up all the integers from 1 to n, let’s recap how to add up all the integers from 1 to 100. The key to this is our friend the associative property of addition which says that you are free to add together a group of numbers in any order you like. In the past, we’ve seen how this freedom can be used to help you perform lightning fast mental addition, and now this same property comes to the rescue again since it means that we’re free to add up all the numbers from 1 to 100 in pairs.