Q:

If $n$ is a perfect square and a perfect cube then $7$ divides $n(n-1) $

If a positive integer $n$ is both a perfect square and a perfect cube , then is it true that $7$ divides $n(n-1)$ ?  

A:

You can write $n=m^6$. Then, you use the Euler's theorem. If $m=0\mod 7$, then
$$n=0 \mod 7$$
and the first factor in $n(n-1) \mod 7$ is $0$. In all other cases, $m$ and $7$ are coprime and by Euler's theorem, it holds
$$n=m^{7-1}=1\mod 7$$
meaning that
$$n-1=0\mod 7$$
Both results together mean that $n(n-1)=0\mod 7$.

