Maths Olympiad Prep

Track / Stage 4 / 47 of 340 #787 of 2444

Problem 787

AMC 12 late, AIME early
Number theory Difficulty 4.3 Prove it Japan Junior Mathematical Olympiad · Japan

How many positive integers nn less than or equal to 10001000 are there for which the sum of digits of 5n5n is the same as the sum of digits of nn?

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

10001000 does not satisfy the requirement, so let us consider only positive integers n999n \le 999. One can represent such an integer in the form 100a+10b+c100a + 10b + c where a,b,ca, b, c are 1-digit non-negative integers. Since the number obtained by multiplying a 1-digit integer by 55 is at most 4545 and its one's digit is either 00 or 55, we see that there is no carry-over in the addition 5a100+5b10+5c5a \cdot 100 + 5b \cdot 10 + 5c. Hence if n=a100+b10+cn = a \cdot 100 + b \cdot 10 + c, then S(5n)=S(5a)+S(5b)+S(5c)S(5n) = S(5a) + S(5b) + S(5c). Furthermore, if kk is an even 1-digit number, then S(5k)=k2S(5k) = \frac{k}{2}, while if kk is an odd 1-digit number, then S(5k)=k+92S(5k) = \frac{k+9}{2}. Therefore, if S(N)=SS(N) = S for a positive integer NN less than or equal to 999999, then S(5N)=S+92S(5N) = \frac{S+9\ell}{2}, where \ell is the number of odd integers among the one's, ten's and hundred's digits of NN.

The remainder one gets when one divides a positive integer nn by 99 equals the remainder one gets when S(n)S(n) is divided by 99. Hence if S(N)=S(5N)S(N) = S(5N), then NN must be a multiple of 99. There are 111111 multiples of 99 less than or equal to 999999. We will find, by grouping them into sub-classes and checking, how many numbers among these will not satisfy the condition S(5N)=S(N)S(5N) = S(N).

(1) When S(N)=9S(N) = 9.
Since S(5N)=S(N)+92S(5N) = \frac{S(N)+9\ell}{2}, where \ell is the number of integers among the one's, ten's and hundred's digits of NN, \ell must be 11 if NN in this class satisfies S(5N)=S(N)S(5N) = S(N). Consequently, among those NN's in this class which do not satisfy the requirement have a representation corresponding with (a,b,c)(a, b, c) given by (1,1,7),(1,3,5),(3,3,3)(1, 1, 7), (1, 3, 5), (3, 3, 3) and their permutations, and there are exactly 3+6+1=103+6+1=10 such numbers.

(2) When S(N)=18S(N) = 18.
Among NN's in this class those which satisfy the requirement have exactly 22 odd integers among their one's, ten's and hundred's digits. If one such NN is written as a100+b10+ca \cdot 100 + b \cdot 10 + c, then the number 999N=(9a)100+(9b)10+(9c)999 - N = (9 - a) \cdot 100 + (9 - b) \cdot 10 + (9 - c) belongs to the class (1) and satisfies the requirement, and conversely, if N=a100+b10+cN' = a' \cdot 100 + b' \cdot 10 + c' is a number belonging to the class (1), which satisfies the requirement, then 999N=(9a)100+(9b)10+(9c)999 - N' = (9 - a') \cdot 100 + (9 - b') \cdot 10 + (9 - c') belongs to class (2) and satisfies the requirement. Thus, there is a one-to-one correspondence between elements of class (1) and those of class (2), and the correspondence preserves the validity of the requirement. Therefore, as in class (1) there are 1010 numbers in class (2) which do not satisfy the requirement.

There is only the number 999999 belonging to this class, and this number satisfies the requirement.

Thus, among the multiples of 99, there are 10×2=2010 \times 2 = 20 numbers which do not satisfy the requirement, and hence there are exactly 11120=91111 - 20 = 91 positive integers NN less than or equal to 10001000 for which S(5N)=S(N)S(5N) = S(N).

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.