<s>[INST] Finding the last digit of $7^n$, $n\ge 1$. 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.  
 [/INST] 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).$$
</s>