[Math] A five-digit number whose square has its last five digits equal to the number.

elementary-number-theorynumber theory

Pretty straightforward problem as the title suggests, but I don't know how to start:

Find a five digit number, so that its square has its last five digits equal to the number.

Best Answer

Instead of a five-digit number, let's find a two-digit number. We want $x^2 - x = x(x-1)$ to be a multiple of 100. So it's a multiple of 4 and of 25.

Now, one of $x-1$ and $x$ is even and the other is odd. Let's say that the even one is a multiple of 4 (since the odd one won't contribute any powers of 2) and the odd one must be a multiple of 25.

So either $x$ is a multiple of 4 and $x-1$ is a multiple of 25, or $x-1$ is a multiple of 4 and $x$ is a multiple of 25. It's not too hard to check all the cases and see that we get $x = 76$ in the first case and $x = 25$ in the second case. When there are more digits, use the Chinese Remainder Theorem to solve the simultaneous congruences.

(Alternatively, $x$ could be a multiple of 4 and of 25, giving $x = 0$, or $x-1$ could be a multiple of 4 and of 25, giving $x = 1$. But these are trivial.)

Related Question