$n$ last digits of $n^2$ have to equal $4$

99 Views Asked by At

I guess its about number theory.

I search for which positive integers n there is a square number, whose last n digits in the Decimal system are all equal to $4$.

I have attempted approach:

So it says

$\displaystyle x^2 = 10^{c_1} a_1 + 10^{c_2} a_1 + ... + 10^c_d a_d = 4$

Every a is a factor of $4$ or $14$ or $24$ or $10^ca_n + 4$

We do not know how long the equation will be but we need to determine the integers $n$.

Maybe the problem can be solved easier (with modulo?)

I actually have no further clue. Thx for help.

1

There are 1 best solutions below

0
On

You will never have a square ending in $4444$.

The square root of such a number is even, thus the proposed square equals $(2n)^2$ for some whole number $n$. Then from basic modular arithmetic:

$4n^2\equiv 4444\bmod 10000$

Divide by $4$, since the modulus is a multiple of $4$ that too must be divided by $4$:

$n^2\equiv 1111\bmod 2500$

Then $n^2$ has to end with $11$, one less than a multiple of $4$, and we are crying a river.

Since $38^2=1444$, the solution set for $n$ is $\{1,2,3\}$.