## Suggested Solution to Question 24 and 25 of the Fermat Math Contest 2018

Posted: March 20, 2018 in Mathematics

Q24.

Denote $G_i, R_i, B_i, Y_i$ as the i-th bucket that contains the puck.

If all 4 pucks are distributed into the same Green bucket, then we don’t need to worry about the Red, Blue, and Yellow buckets since they won’t have 4 pucks in them. So,

$\displaystyle P(G_a, G_a, G_a, G_a) = 3 \left(\frac13\right)^4 = \frac{1}{27}$

Now, 3 pucks are distributed into the same Green bucket, then we only need to exclude the case where 3 pucks are put into the same Red bucket. There are 4 ways to permute aaab and 3 numbers to pick for a and b which is 6 ways, so

$\displaystyle P(G_a, G_a, G_a, G_b) \cdot (1 - P(R_a, R_a, R_a)) = 4 \cdot 6 \cdot \left(\frac13\right)^4 \cdot \left(1-3 \left(\frac13\right)^3\right) = \frac{64}{243}$

If 2 pucks are distributed into the same Green bucket, then we only need to consider the case where all 3 pucks are distributed evenly into three different Red buckets and all 2 pucks are distributed evenly into two different Blue buckets. The most difficult part of the problem is in this case here. We need to find the number of ways to permute n repeated objects, aabc, which is $\dfrac{4!}{2!1!1!}$, and since the permutation of b and c has already counted, we need to only consider how many numbers go into the choice of a which is 3.

$\displaystyle P(G_a, G_a, G_b, G_c) \cdot P(R_a, R_b, R_c) \cdot P(B_a, B_b) \\ = \frac{4!}{2!1!1!}\cdot 3 \cdot \left(\frac13\right)^4 \cdot 3!\left(\frac13\right)^3 \cdot (3P2) \left(\frac13\right)^2 \\ = \frac{4}{9}\cdot\frac{2}{9}\cdot\frac{2}{3} = \frac{16}{243}$

Final step, add the three results and we get

$\displaystyle \frac{1}{27} + \frac{64}{243} + \frac{16}{243} = \frac{89}{243}$

Q25.

For $1 \leq k \leq 2018$ and $P, Q, R \in \{1,2,\ldots,9\}$

$P_{2k} - Q_k = (R_k)^2$

When k = 1,

$11P - Q = R^2$. The 8 quadruples are easy to find, they are

$(1,7,2,1), (1,2,3,1), (2,6,4,1), (3,8,5,1), (4,8,6,1), (5,6,7,1), (6,2,8,1), (8,7,9,1)$

When k = 2,

$1111P - 11Q = 11^2R^2 \Rightarrow 101P - Q = 11R^2$

When k = 3,

$111111P - 111Q = 111^2R^2 \Rightarrow 1001P - Q = 111R^2$

$\therefore (10^k+1)P-Q=\dfrac{10^k-1}{10-1}\cdot R^2 \Rightarrow (10^k+1)P-Q=\dfrac{10^k-1}{9} \cdot R^2$

or

$P-Q \equiv 11R^2 \pmod{100} \text{ for } k \geq 2$

$\underline{\quad R \qquad R^2 \qquad 11R^2 \qquad 11R^2 \mod{100} \quad} \\ \text{ } \quad 1 \qquad 1 \quad \qquad 11 \qquad\qquad\qquad 11 \\ \text{ } \quad 2 \qquad 4 \quad \qquad 44 \qquad\qquad\qquad 44 \\ \text{ } \quad 3 \qquad 9 \quad \qquad 99 \qquad\qquad\qquad 99 \equiv -1 \\ \text{ } \quad 4 \qquad 16 \quad \quad 176 \qquad\qquad\qquad 76 \\ \text{ } \quad 5 \qquad 25 \quad \quad 275 \qquad\qquad\qquad 75 \\ \text{ } \quad 6 \qquad 36 \quad \quad 396 \qquad\qquad\qquad 96 \equiv -4 \\ \text{ } \quad 7 \qquad 49 \quad \quad 539 \qquad\qquad\qquad 39 \\ \text{ } \quad 8 \qquad 64 \quad \quad 704 \qquad\qquad\qquad 4 \\ \text{ } \quad 9 \qquad 81 \quad \quad 891 \qquad\qquad\qquad 91$

Therefore, R can only be 3, 6, or 8.

When R = 3,

$(10^k + 1)P - Q = 10^k - 1$

$10^k P + P - Q = 10^k - 1$

$\text{Since } P - Q \equiv -1 \mod{100}$

$10^k P - 1 = 10^k - 1$

$\Rightarrow P = 1, Q = 2 \quad \therefore (1,2,3,k) \text{ for } 1 < k \leq 2018$

When R = 6,

$(10^k + 1)P - Q = \dfrac{10^k-1}{9} \cdot 36$

$10^k P - 4 = 4\cdot 10^k - 4$

$\Rightarrow P = 4, Q = 8 \quad \therefore (4,8,6,k) \text{ for } 1 < k \leq 2018$

When R = 8,

$(10^k + 1)P - Q =\dfrac{10k-1}{9} \cdot 64$

$9(10^k P + 4) = 64 \cdot 10^k - 64$

$9 \cdot 10^k P + 36 = 64 \cdot 10^k - 64$

$100 = (64 - 9P) 10^k$

Now, obviously $k > 2$ has no solution.

If k = 2,

$1 = 64 -9P$

$\Rightarrow P = 7, Q = 3$

$\therefore (7,3,8,2)$ is a solution.

In conclusion, N = 8 + 2017 + 2017 + 1 = 4043.

Therefore the sum of digits of N is 11.