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