Lời giải:
$A=1^n+2^n+3^n+4^n=1+2^n+3^n+4^n$
Nếu $n=4k$ thì:
$A=1+2^n+3^n+4^n=1+2^{4k}+3^{4k}+4^{4k}$
$=1+16^k+81^k+16^{2k}$
$\equiv 1+1+1+1\equiv 4\pmod 5$
---------------
Nếu $n=4k+1$
$A=1+2^n+3^n+4^n=1+2^{4k+1}+3^{4k+1}+4^{4k+1}$
$=1+16^k.2+81^k.3+16^{2k}.4$
$\equiv 1+1^k.2+1^k.3+1^k.4\equiv 10\equiv 0\pmod 5$
Nếu $n=4k+2$
$A=1+2^n+3^n+4^n=1+2^{4k+2}+3^{4k+2}+4^{4k+2}$
$=1+16^k.2^2+81^k.3^2+16^{2k}.4^2$
$\equiv 1+1^k.2^2+1^k.3^2+1^{2k}.4^2\equiv 30\equiv 0\pmod 5$
Nếu $n=4k+3$
$A=1+2^n+3^n+4^n=1+2^{4k+3}+3^{4k+3}+4^{4k+3}$
$=1+16^k.2^3+81^k.3^3+16^{2k}.4^3$
$\equiv 1+1^k.2^3+1^k.3^3+1^{2k}.4^3\equiv 100\equiv 0\pmod 5$
Vậy chỉ cần $n$ không chia hết cho $4$ thì $1^n+2^n+3^n+4^n$ sẽ chia hết cho $5$