document.write( "Question 1209367: Find the sum of all positive integers less than 1000 ending in 3 or 4 or 5 or 8. \n" ); document.write( "
Algebra.Com's Answer #848682 by math_helper(2461)\"\" \"About 
You can put this solution on YOUR website!

\n" ); document.write( "I'm going to do more work than the problem requires, to make sure I'm doing
\n" ); document.write( "it correctly, and hopefully this method helps you gain some intuition.\r
\n" ); document.write( "\n" ); document.write( "Sum of all positive integers less than 1000 ending in 0:
\n" ); document.write( "Sum(0+10n; n=0,...,99) = 0*sum(0, n=0,...,99) + 10*sum(0...99) = 10*(99*100/2)
\n" ); document.write( " = 0 + 49500 = 49500\r
\n" ); document.write( "\n" ); document.write( "Sum of all positive integers less than 1000 ending in 1:
\n" ); document.write( "Sum(1+10n; n=0,...,99) = 1*sum(1, n=0,...,99) + sum(10n, n=0,...,99)
\n" ); document.write( " = 100 + 49500 = 49600\r
\n" ); document.write( "\n" ); document.write( "Repeating the above two calculations and noting we just add 100 for each
\n" ); document.write( "higher digit:\r
\n" ); document.write( "\n" ); document.write( "Sum of all positive integers less than 1000 ending in 0: 49500
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 1: 49600
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 2: 49700
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 3: 49800 (#)
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 4: 49900 (#)
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 5: 50000 (#)
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 6: 50100
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 7: 50200
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 8: 50300 (#)
\n" ); document.write( "Sum of all positive integers less than 1000 ending in 9: 50400
\n" ); document.write( " total: 499500\r
\n" ); document.write( "\n" ); document.write( "Sanity check the above total, which should be the same as ALL numbers 0...999:
\n" ); document.write( "Sum(n; n=0,...,999) = 999*1000/2 = 499500 \r
\n" ); document.write( "\n" ); document.write( "Sum the rows with (#), you should get 200000
\n" ); document.write( " \n" ); document.write( "
\n" );