1
$\begingroup$

The problem is:

Find the sum of all the numbers from $1$ to $100$ when all the $6$'s are replaced by $9$'s.

I need some ideas on how to approach this kind of problems? Please explain your ideas, assuming one digit replacements.

2 Answers 2

8

One way is to add the numbers $1$ to $100$ to get $5050$, then reflect that there are $10$ sixes in the ones place and $10$ sixes in the tens place. So you have $5050+10*(9-6) +10*(90-60)=5380.$

If you just need the difference, it is $10*(9-6) +10*(90-60)=330$

  • 1
    Well that makes me feel foolish!2011-07-19
  • 1
    That's superb method,like many-times whenever I read and understand your answers I end up learning a thing or two .. :)2011-07-19
3

Hint:

  1. Can you find the sum $1 + 2 + \dots 100$?

  2. What are all the values between $1$ and $100$ that have a $6$ in them? List them.


(Edit:) The process is the same for the numbers $1, \dots , 10$. You would add up all the values $1 + \dots + 10 = \frac{10 \cdot 11}{2} = 55$. Then, subtract each number with a $6$ to get $55 - 6 = 49$. Then, change the $6$ to a $9$, and add it back in: $49 + 9 = 58$. The same process works for the numbers $1, \dots , 100$:

  1. $1 + \dots + 100 = 5050$.

  2. Add together all the digits with a $6$:

$$\begin{align} &6 + 16 + \dots + 56 + 60 + 61 + \dots + 69 + 76 + 86 + 96 \\ &= (6 + 16 + \dots + 96) + (60 + \dots + 69) - 66 \\ &= (10\cdot 6 + 10 + 20 + \dots + 90) + (10 \cdot 60 + 1 + 2 + 3 + \dots + 9) - 66 \\ &= \left(60 + 10(1 + 2 + \dots + 9)\right) + \left(600 + \frac{9\cdot 10}{2} \right) - 66 \\ &= (60 + 10\cdot 45) + (600 + 45) - 66 \\ &= 1089. \end{align}$$

EDIT (#$2$):

This process amounts to subtracting all the values with a $6$, and then adding the numbers with a $9$. Perhaps a quicker way to do this is to add to $5050$, the quantity

$$ 9-6 + 19-16 + 29-26 + \dots 59-56 + 90-60+ 91-61 + \dots 99-69 + 79-76 + \dots. $$

  • 0
    (1) Yes,$\frac{100 \times 101}{2}$ = ... (2) $6,16,26,36,46,56,60-69,76,86,96.$ Not getting what to do next ..2011-07-19
  • 0
    Okay, so now what?2011-07-19
  • 0
    yes,that's what I am asking,don't tell me that I have to sum them up manually and then subtract ?2011-07-19
  • 0
    Well what would you do if the same question was asked, but instead of the numbers $1, 2, \dots , 100$ it was only $1, 2, \dots , 10$?2011-07-19
  • 0
    In that case as the numbers are small I will sum them and substract.2011-07-19
  • 0
    Well, for your question, the numbers are also reasonable. Just add together all the numbers with a $6$ in them, and subtract that value from $5050$. Then, add the corresponding numbers with the $9$s replacing the $6$s.2011-07-19
  • 0
    Reasonable yes,but not possible within a mint,anyways what would be the approach if I just have to find the difference between this sum and the actual one ?2011-07-19
  • 0
    I have added a general way to find the sum of the numbers with the digit $6$ in them. You can use exactly the same method to find the sum of the numbers with the digit $9$.2011-07-19