Enormous Sum
November 03, 2008 Compute the sum of the sum of all 8-digit numbers and the sum of all 10-digit numbers.
All rhe 8 digit numbers are from 10,000,000 to 99,999,999
And there are (99,999,999 - 10,000,000,000) + 1 = 90,000, 000 of these
So, we have 45,000,000 pairs and each pair sums to (10,000,000 + 99,999,999).....the sum is just (10,000,000 + 99,999,999) * (45,000,000) = 4,949,999,955,000,000
And all the 10 digit numbers are from 1,000,000,000 to 9,999,999,999
And there are (9,999,999,999 - 1,000,000,000) + 1 = 9,000,000,000 of these
So, we have 4,500,000,000 pairs of these.......and each pair sums to (1,000,000,000 + 9,999,999,999).....so the total sum is just (1,000,000,000 + 9,999,999,999) * (4,500,000,000) = 4,949,999,999,550,0000,000
So the total sum is 4,949,999,955,000,000 + 49,499,999,995,500,000,000 = 49,504,949,995,455,000,000
The smallest 8 digit number is 10,000,000; the largest is 99,000,000.
If you write all of them: 10,000,000 and 10,000,001 and 10,000,002, etc., you will have an arithmetic sequence (you can always get the next one by adding 1 to the previous one).
The formula for the sum of an arithmetic sequence is: Sum = n(f + l)/2
where n = number of terms = 89,000,001,
f = first term = 10,000,000
and l = last term = 99,000,000
So, the sum of all the 8 digit numbers is: 89 000 001(10 000 000 + 99 000 000) / 2
Similarly, for 10 digit numbers.
All rhe 8 digit numbers are from 10,000,000 to 99,999,999
And there are (99,999,999 - 10,000,000,000) + 1 = 90,000, 000 of these
So, we have 45,000,000 pairs and each pair sums to (10,000,000 + 99,999,999).....the sum is just (10,000,000 + 99,999,999) * (45,000,000) = 4,949,999,955,000,000
And all the 10 digit numbers are from 1,000,000,000 to 9,999,999,999
And there are (9,999,999,999 - 1,000,000,000) + 1 = 9,000,000,000 of these
So, we have 4,500,000,000 pairs of these.......and each pair sums to (1,000,000,000 + 9,999,999,999).....so the total sum is just (1,000,000,000 + 9,999,999,999) * (4,500,000,000) = 4,949,999,999,550,0000,000
So the total sum is 4,949,999,955,000,000 + 49,499,999,995,500,000,000 = 49,504,949,995,455,000,000