I want to calculate, how many solutions there are that satisfy the equation $x^2 \equiv x^4 \mod n$
My approach is to write $x$ as the $t$-th power of a primitive root $g$ and solve
$(g^{t})^2 \equiv (g^{t})^4 \mod n$
$g^{2t} \equiv g^{4t} \mod n$
Knowing that $g$ is a generator we get
$2t \equiv 4t \mod \phi(n)$
$2t \equiv 0 \mod \phi(n)$
So knowing that $ \phi(n) \ | \ 2t$ , the amount of solutions t we get is
$\gcd(2t, \phi(n))$ as the amount of solutions.
As experiments show, that solution is false. Does anyone see the error or know how to find the number of solutions?