Suppose that the song "99 Bottles of Beer on the Wall" was sung from beginning to end.
What would be the sum of all the numbers (including repeats, of course) in the song?
Then, suppose you have some arbitrary number n bottles, which you would like to sing about. Find a formula in terms of n for the sum of all the numbers you will be singing.
Well, the verse goes
"99 bottles of beer on the wall, 99 bottles of beer, take 1 down, pass it around, 98 bottles of beer on the wall."
Let's say 99= n.
"n bottles of beer on the wall, n bottles of beer, take 1 down, pass it around, (n-1) bottles of beer on the wall."
Thus, in one round 3n is the sum of numbers said ( n + n + (n-1) + 1 [from "take 1 down"]). This 3(the number of that round) will continue all the way to 0. So.. the general formula would be...
3 (n + (n - 1) + (n - 2) + (n - 3) + ... + 2 + 1). Thus, with "99 bottles of beer on the wall," the sum would be 3 x 4950 = 14850