Knowing that $n= 3598057$ is a product of two different prime numbers and that 20779 is a square root of $1$ mod $n$, find prime factorization of $n$.
What I have done so far:
$n = p \cdot q$
$x^2 \equiv 1\pmod{n}$
$x^2 -1 \equiv 0\pmod{n}$
$(x-1)(x+1) \equiv 0\pmod{n}$
$x-1 = 20779 \lor x + 1=20779$
I have also noticed that:
$(x-1)(x+1) \equiv 0\pmod{p \cdot q}$
$(x-1)(x+1) \equiv 0\pmod{p} \land (x-1)(x+1) \equiv 0\pmod{q}$
But I have no idea what to do next. Any hints?