**2014 SMO (Senior-Rd1) 17.** Let be a positive integer such that is a 4-digit number with all 4 digits equal. Determine the value of .

Let for some digit . A brute-force method would be to let run through 1 to 9: for each value of , solve the quadratic equation in and check if the resulting value of is a positive integer. The problem with this method is that there will be big numbers encountered in the process, which would slow down the problem solving process.

Let’s try to make use of the given expression. What stands out is the 2 coefficients 12: how nice it would be if the last coefficient was 12 as well! Instead, it is 11. What this means is that * must be 1 less than a multiple of 12*.

**We can use moduli to narrow down the possibilities for .**For instance, we know that must be odd, hence

Why stop at considering just ? Taking , since

,

we must have

(*Exercise: Prove that for all positive integers .*) The only odd value of that satisfies the congruence above is . Hence, we must have

Since is a positive integer, we must have . The answer is **21**.