I need to find all pairs of three-digit integers $(m,n)$ with $m,n \in N $that fit the following conditions:

a) $m-n=889$

b) For the digit sum $Q(m)$ and $Q(n)$ let: $Q(m)-Q(n)=25$

My ideas:

I tried figuring out all pairs but I am not quite sure if I am on the right track:

We can write three-digit integers just like this:

$m=a_1 \cdot100+b_1 \cdot 10+c_1 $

$n=a_2 \cdot100+b_2 \cdot 10+c_2 $

We can just plug this in condition a) : $100(a_1-a_2)+10(b_1-b_2)+(c_1-c_2)=889$

And with b) we get another equation:

since $Q(m)=a_1+b_1+c_1$ and $Q(n)=a_2+b_2+c_2$

we have: $(a_1-a_2)+(b_1-b_2)+(c_1-c_2)=25 $

To sum up we have the following equations:

1.) $100(a_1-a_2)+10(b_1-b_2)+(c_1-c_2)=889$

2.) $(a_1-a_2)+(b_1-b_2)+(c_1-c_2)=25 $

At this point I am stuck because these are two equations for 6 unknowns and the solutions have to be integers. Is this even the right way?

I am very thankful for any kind of help! :)

  • 3
    $\begingroup$ Well, there really aren't all that many pairs of three digit numbers satisfying $m-n=889$. Add to that the fact that, for any three digit number, we know that $Q(m)≤27$ and $Q(n)≥1$ and the list narrows considerably. $\endgroup$
    – lulu
    May 2 at 15:58
  • 1
    $\begingroup$ Note: you should clarify whether or not you are counting, say, $12$ or $5$ or $0$ as three digit numbers. Doesn't change the answer much, of course. $\endgroup$
    – lulu
    May 2 at 16:01
  • 1
    $\begingroup$ Your approach grossly overcomplicates the situation. This problem can be done mentally. $\endgroup$
    – lulu
    May 2 at 16:07
  • 1
    $\begingroup$ I don't understand. From my first comment (and assuming that you aren't allowing $n<100$) we see that $Q(m)$ can only be $27$ or $26$. Thus $m\in \{999,998, 989, 899\}$. All that remains is to check each case. $\endgroup$
    – lulu
    May 2 at 16:10
  • 1
    $\begingroup$ Quick computer search yields: $\{ \{100, 989 \}, \{110, 999 \} \}$ $\endgroup$ May 2 at 16:24

1 Answer 1


Three digit means $n>=100$, and $m<=999$

Which means there are only 11 possibilities ($n=100,101,...,110$, $m=989,990,...,999$)

Calculating the $Q$s for each possibility, $n=100$, $m=989$ works

$n=$101-109, $m=$990-998 gives $Q(m)-Q(n)$ as 16 for all (the first two digits are constant, the last increases the same for each)

$n=110$, $m=999$ works

When there are only 11 options, 9 of which you can discard straight away, you don't really need any equations

Generalising for different limits would be trickier, but the insight that, if only the last digit is changing for both numbers, $Q(m)-Q(n)$ will be constant, might be useful


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.