For each positive digit D and positive integer k, we use the symbol D(k) to represent the positive integer having exactly k digits, each of which is equal to D. For example, 2(1)=2 and 3(4)=3333. There are N quadruples (P,Q,R,k) with P,Q and R positive digits, k a positive integer with k≤2018, and P(2k)−Q(k)=(R(k))2. What is the sum of the digits of N?
A number or a short expression. Spacing and $ signs are ignored.
Solution
Suppose that D is a digit and k is a positive integer. Then D(k)=k times DD⋯DD=D⋅k times 11⋯11=D⋅91⋅k times 99⋯99=D⋅91⋅(k times 00⋯00−1)=D⋅91⋅(10k−1). Therefore, the following equations are equivalent: P(2k)−Q(k)=(R(k))2, P⋅91⋅(102k−1)−Q⋅91⋅(10k−1)=(R⋅91⋅(10k−1))2, P⋅91⋅(102k−1)−Q⋅91⋅(10k−1)=R2⋅811⋅(10k−1)2, 9P⋅(102k−1)−9Q⋅(10k−1)=R2⋅(10k−1)2, 9P⋅(10k−1)(10k+1)−9Q⋅(10k−1)=R2⋅(10k−1) (since 10k−1=0), 9P⋅10k+9K−9Q=R2⋅10k−R2, 9P−9Q+R2=10k(R2−9P). We consider three cases: 3≤k≤2018,k=1, and k=2. Case 1: 3≤k≤2018. Suppose that R2−9P=0. Since k≥3, then 10k(R2−9P)>1000 if R2−9P>0 and 10k(R2−9P)<−1000 if R2−9P<0. Since P,Q,R are digits, then 9P−9Q+R2 is at most 9(9)−9(0)+92=162 and 9P−9Q+R2 is at least 9(0)−9(9)+02=−81. This means that if R2−9P=0, we cannot have 9P−9Q+R2=10k(R2−9P) since the possible values do not overlap. So if 3≤k≤2018, we must have R2−9P=0 and so 9P−9Q+R2=0. If R2=9P, then R2 is a multiple of 3 and so R is a multiple of 3. Since R is a positive digit, then R=3 or R=6 or R=9. If R=3, then 9P=R2=9 and so P=1. Since 9P−9Q+R2=0, then 9Q=9(1)+9=18 and so Q=2. If R=6, then 9P=R2=36 and so P=4. Since 9P−9Q+R2=0, then 9Q=9(4)+36=72 and so Q=8. If R=9, then 9P=R2=81 and so P=9. Since 9P−9Q+R2=0, then 9Q=9(9)+81=162 and so Q cannot be a digit. Therefore, in the case where 3≤k≤2018, we obtain the quadruples (P,Q,R,k)=(1,2,3,k) and (P,Q,R,k)=(4,8,9,k). Since there are 2018−3+1=2016 possible values of k, then we have 2⋅2016=4032 quadruples so far. Case 2: k=1. Here, the equation 9P−9Q+R2=10k(R2−9P) becomes 9P−9Q+R2=10R2−90P or 99P=9R2+9Q or 11P=R2+Q. For each possible value of P from 1 to 9, we determine the possible values of Q and R by looking for perfect squares that are at most 9 less than 11P. P=1: Here, 11P=11 which is close to squares 4 and 9. We obtain (R,Q)=(2,7),(3,2). P=2: Here, 11P=22 which is close to the square 16. We obtain (R,Q)=(4,6). P=3: Here, 11P=33 which is close to the square 25. We obtain (R,Q)=(5,8). P=4: Here, 11P=44 which is close to the square 36. We obtain (R,Q)=(6,8). P=5: Here, 11P=55 which is close to the square 49. We obtain (R,Q)=(7,6). P=6: Here, 11P=66 which is close to the square 64. We obtain (R,Q)=(8,2). P=7: There are no perfect squares between 68 and 76, inclusive. P=8: Here, 11P=88 which is close to the square 81. We obtain (R,Q)=(9,7). P=9: There are no perfect squares between 90 and 98, inclusive. Since k=1 in each of these cases, we obtain an additional 8 quadruples. Case 3: k=2. Here, the equation 9P−9Q+R2=10k(R2−9P) becomes 9P−9Q+R2=100R2−900P or 909P=99R2+9Q or 101P=11R2+Q. As P ranges from 1 to 9, the possible values of 101P are 101, 202, 303, 404, 505, 606, 707, 808, 909. As R ranges from 1 to 9, the possible values of 11R2 are 11,44,99,176,275,396,539,704,891. The pairs of integers in the first and second lists that differ by at most 9 are (i) 101 and 99 (which give (P,Q,R)=(1,2,3)), (ii) 404 and 396 (which give (P,Q,R)=(4,8,6)), and (iii) 707 and 704 (which give (P,Q,R)=(7,3,8)). Since k=2 in each of these cases, we obtain an additional 3 quadruples. In total, there are thus N=4032+8+3=4043 quadruples. The sum of the digits of N is 4+0+4+3=11.
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: Omni-MATH,
licensed Apache-2.0.
Statement and solution reproduced as published; topic and difficulty added by this site.