What is the sum of all the positive integers with 2 different digits till $100$ (without numbers with one digit and $100$) ?
This was a problem I thought after hearing about Gauss and the Sum of integer till $100$. Here's how I tried to solve it:
I know that the sum of all the positive integer till $100$ that's $5050$ and that's given by the formula:
$$\sum_{k=0}^n k = \frac{n(n+1)}{2}$$
So if I take the sum of all the integers and subtract the sum of all the integers with the same digits I'll get my result. So: $$5050-(11+22+33+44+55+66+77+88+99)= 5050-11(1+2+3+4+5+6+7+8+9)= 5050-11\left(\frac{9\cdot 10}{2}\right)=4555 $$ Is this right? Thanks!
I know you had given this in your question but I am typing this again$$5050-(11+22+33+44+55+66+77+88+99)$$ $$= 5050-11(1+2+3+4+5+6+7+8+9)$$ $$= 5050-11\left(\frac{9\cdot 10}{2}\right)=4555 $$
Your answer and method both are completely correct. Since you just need the numbers with $2$ different digits and $100$ has $2$ different digits i.e. $1$ and $0$. Hence you don't need to subtract $100$ also.