Problem:
For positive integer n, let s(n) denote the sum of the digits of n. Find the smallest positive integer n satisfying s(n)=s(n+864)=20.
Solution:
When adding two numbers, a carry operation replaces 10 in the k th position with 1 in the (k+1) st position, thus reducing the sum of these values by 10β1=9. Therefore s(n+864)=s(n)+s(864)β9c, where c is the number of carries performed when adding the two numbers.
To have s(n)=20 and 20=s(n+864)=s(n)+s(864)β9c=20+18β9c, there must be precisely c=2 carries when performing the addition n+864. Assuming that n<1000, represent the three-digit number n as tβuβvβ. Because u+vβ€9+9=18, it follows that tβ₯2, and thus the hundreds position t+8 must carry. Thus either the tens or the ones position carries, and the other does not.
If the ones carry and the tens do not, then the middle digit of the sum must be 6+u+1β€9, so uβ€2. The only possibility is then n=929, which indeed satisfies the conditions: s(929)=20=s(929+864)=s(1793).
In the other case, the tens carry and the ones do not, so v+4β€9 and vβ€5. It follows that t=20βuβvβ₯20β9β5=6, so nβ₯695. Indeed s(695)=20=s(695+864)=s(1559). The smallest positive integer for which s(n)=s(n+864)=20 is 695β.
OR
Note that the least n for which s(n)=20 is n=299. For n with s(n)=20, let
n have, in order, the digits a,b, and 20β(a+b), so aβ₯2 and a+bβ₯11. If a+bβ€14, and b<3, then n+864 has digits 1,aβ2,b+7, and 14β(a+b), implying that s(n+864)=20. The least such n occurs when a=9 and b=2, so n=929. If a+bβ€14, and bβ₯3, then n+864 has digits 1,aβ1,bβ3, and 14β(a+b), implying that s(n+864)=11.
If a+bβ₯15 or b<4, then n+864 has digits 1,aβ2,b+6, or 24β(a+b), implying that s(n+864)=29. If a+bβ₯15 and bβ₯4, then n+864 has digits 1,aβ1,bβ4, and 24β(a+b), implying that s(n+864)=20. The least such n occurs when a=6 and b=9, so n=695β.
The problems on this page are the property of the MAA's American Mathematics Competitions