Problem:
An integer between 1000 and 9999, inclusive, is called balanced if the sum of its two leftmost digits equals the sum of its two rightmost digits. How many balanced integers are there?
Solution:
For a balanced four-digit integer, the sum of the leftmost two digits must be at least 1 and at most 18. Let f(n) be the number of ways to write n as a sum of two digits where the first is at least 1 , and let g(n) be the number of ways to write n as a sum of two digits. For example, f(3)=3, since 3=1+2=2+1=3+0, and g(3)=4. Then
f(n)={n19βnβ for 1β€nβ€9, for 10β€nβ€18,ββ
and
g(n)={n+119βnβ for 1β€nβ€9 for 10β€nβ€18ββ
For any balanced four-digit integer whose leftmost and rightmost digit pairs both have sum n, the number of possible leftmost digit pairs is f(n) because the leftmost digit must be at least 1, and the number of possible rightmost digit pairs is g(n). Thus there are f(n)β
g(n) four-digit balanced integers whose leftmost and rightmost digit pairs both have sum n. The total number of balanced four-digit integers is then equal to
n=1β18βf(n)β
g(n)β=n=1β9βn(n+1)+n=10β18β(19βn)2=n=1β9β(n2+n)+n=1β9βn2=2n=1β9βn2+n=1β9βn=2(12+22+β―+92)+(1+2+β―+9)=615ββ
The problems on this page are the property of the MAA's American Mathematics Competitions