SOLUTION: How many integers are there between 1 and 1 000 000 whose sum of digits add up to 25?

Algebra.Com
Question 1133940: How many integers are there between 1 and 1 000 000 whose sum of digits add up to 25?
Found 2 solutions by math_helper, MathTherapy:
Answer by math_helper(2461)   (Show Source): You can put this solution on YOUR website!

53262


To see just the count:

perl -e '$c=0; $s=0; for($i=1; $i<1000001; $i++) { @w = split(//,"$i"); for($j=0,$s=0;$j<$#w+1;$j++) { $s+=$w[$j]; } if ($s == 25) { $c++; } } print "count = $c\n";'


To see them all, run this:

perl -e '$c=0; $s=0; for($i=1; $i<1000001; $i++) { @w = split(//,"$i"); for($j=0,$s=0;$j<$#w+1;$j++) { $s+=$w[$j]; } if ($s == 25) { $c++; print "$i\n"; } } print "count = $c\n";'


Answer by MathTherapy(10552)   (Show Source): You can put this solution on YOUR website!
How many integers are there between 1 and 1 000 000 whose sum of digits add up to 25?
I agree with @MATH_HELPER. He's right "on target."
I did an Excel spreadsheet that summed the digits of numbers starting at 799 - which is the lowest number to have digits that sum
to 25 - and ending at 999,999. I did a count (Excel function) and it is indeed a total of 53,262 numbers with digits that sum to 25.
RELATED QUESTIONS

With a view to estimating how many fish there are in a big lake, 25,000 fish are tagged... (answered by josgarithmetic,ikleyn)
How many integers are there between 10 and 100 whose digits are all... (answered by ikleyn)
How many positive integers are there whose digits strictly decrease from left to right,... (answered by CPhill,ikleyn)
TL Ltd is a multinational construction company with subsidiary organisations all around... (answered by ikleyn)
Consider the integers from 1,000 to 9,999 which have only odd digits. a. How many of... (answered by ikleyn)
it is between 50 000 and 52 000. there is a 2 in the tens place. the sum of the digits... (answered by swincher4391,josmiceli,Edwin McCravy,MathTherapy)
can you show me how to work these out please: 1) The formula S=4 π r2 gives the... (answered by Alan3354)
Atrap and Bracken are two rival insurance companies. Atrap has a yearly premium of $7,000 (answered by MathLover1)
i am a 5 digit number between 40 000 and 50 000. my thousands digit is 1 less than the... (answered by Edwin McCravy)