Lời giải:
$n$ không chia hết cho $3$ nên $n=3k+1$ hoặc $n=3k+2$ với $k$ tự nhiên.
Nếu $n=3k+1$:
$A=5^{2n}+5^n+1=5^{2(3k+1)}+5^{3k+1}+1$
$=5^{6k}.25+5.5^{3k}+1$
Vì $5^3\equiv 1\pmod {31}$
$\Rightarrow A\equiv 1^{2k}.25+5.1^k+1\equiv 31\equiv 0\pmod {31}$
$\Rightarrow A\vdots 31$
Nếu $n=3k+2$ thì:
$A=5^{2(3k+2)}+5^{3k+2}+1$
$=5^{6k}.5^4+5^{3k}.5^2+1$
$\equiv 1^{2k}.1.5+1^k.5^2+1\equiv 5+5^2+1\equiv 31\equiv 0\pmod {31}$
$\Rightarrow A\vdots 31$
Từ 2 TH suy ra $A\vdots 31$ (đpcm)