For which $n\in \mathbb N$ does $n^n$ end with a $3$ in its decimal form?

88 Views Asked by At

For which $n\in \mathbb N$ does $n^n$ end with a $3$ in its decimal form?

I didn't really know where to go from here, but I thought I might be able to use that $n^n \equiv 3 \text{ (mod } 10)$ , $n^n \equiv 3 \text{ (mod } 5)$ and $n^n \equiv 1 \text{ (mod } 2)$. Since the $gcd(2,5)=1$ I thought I might be able to do something with the Chinese remainder theorem, but so far I'm not sure how.

I'd prefer a hint over a full answer :)

Thank you in advance!

1

There are 1 best solutions below

4
On BEST ANSWER

You are correct : if $k \equiv 1 \mod 2$ and $k \equiv 3 \mod 5$ then $k \equiv 3 \mod 10$ must happen by CRT.

Therefore, it is sufficient to find $n$ such that $n^n \equiv 3 \mod 5$ and is odd. Of course, $n^n$ is odd if and only if $n$ is odd.

Additionally, $n^n$ now breaks into cases when we go into five. If $5$ divides $n$, of course $n^n$ can't end with $3$. Therefore, $n$ cannot be a multiple of $5$. Then, $n^4 \equiv 1 \mod 5$, by Fermat's theorem. Therefore, let $n \equiv k \mod 4$, $0 \leq k \leq 3$, then $n^n \equiv n^k \mod 5$. Finally, if $n \equiv l \mod 5$ then $n^n \equiv n^k \equiv l^k \mod 5$ ,where $0 \leq l < 5$. Now, there are not too many cases to check : only $k = 1$ or $3$ and $l = 1,2,3,4$ are to be checked. Can you finish?