I have noticed a cycle of 7,9,3,1. Meaning: $7^1\equiv 7\pmod {10}, 7^2\equiv 9\pmod {10}, 7^3\equiv 3\pmod {10},7^4\equiv 1\pmod {10}, 7^5\equiv 7\pmod {10}$ and so on. Therefore, if $n=4k+1$ the last digit is 7, If $n=4k+2$, the last digit is 9, If $n=4k+3$, the last digit is 3 and if $n=4k$, the last digit is 1. I don't really know how to get to a final, coherent answer. That is as far as I could. I guess I am required to present a specific function the outputs the exact last digit. I would really appreciate your help.
2026-03-30 20:42:58.1774903378
On
On
Finding the last digit of $7^n$, $n\ge 1$.
180 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3
There are 3 best solutions below
0
On
Take $n=4m+k$ where $0\leq k\leq 3$, then $$7^{4m+k}=7^{4m}\cdot 7^k=(7^4)^m\cdot 7^k\equiv 1^m 7^k \equiv 7^k (mod 10).$$
1
On
I think that what you're looking for is something like this :
$$f(n) = \frac{2}{3} (n\%4-(n\%4)^3) + 1$$
it's a result I obtained by using 3rd degree linear regression, with the points $(0,1)$,$ (1,7)$,$ (2,9)$, and $ (3,3)$.
Anaway, I'm pretty sure that nicer solutions exist, just haven't found them yet.
You seem to have everything figured out. For a proof, suppose that $n = 4k + \alpha$, where $\alpha < 4$. Then $$ 7^n = 7^{4k+\alpha} = 7^{4k} 7^{\alpha} = {7^4}^k 7^\alpha = 2401^k 7^\alpha \equiv 1^k 7^\alpha = 7^\alpha, \quad \hbox{ (mod 10)}.$$