When I saw this problem, it came to me that Fermat's little theorem that says:$$a^p\equiv a\mod(p)$$can also been said in general: $$a^{1+(p-1)k}\equiv a\mod(p)$$ Ad since $13$ can be written as:$$1+(2-1)12=13\\1+(3-1)6=13\\1+(5-1)3=13\\1+(7-1)2=13\\1+(13-1)1=13$$Therefor $$n^{13}\equiv n\mod(2\cdot3\cdot5\cdot7\cdot13=2730)$$ But I didn't find a way to prove this generalization $a^{1+(p-1)k}\equiv a\mod(p)$. Maybe someone can help me prove it?
Thanks.