<s>[INST] Given an integer $N$, find solutions to $X^3 + Y^3 + Z^3 - 3XYZ \equiv 1 \pmod{N}$ Given an integer $N > 0$ with unknown factorization, I would like to find nontrivial solutions $(X, Y, Z)$ to the congruence $X^3 + Y^3 + Z^3 - 3XYZ \equiv 1 \pmod{N}$. Is there any algorithmic way to rapidly find such tuples? One special case arises by taking $Z \equiv  0 \pmod{N}$, in which case we can consider the simpler congruence $X^3 + Y^3 \equiv 1 \pmod{N}$. Does anyone know how to find such $(X, Y)$?
 [/INST] Since, $X^3+Y^3+Z^3-3XYZ=\frac{1}{2}(X+Y+Z)((X-Y)^2+(Y-Z)^2+(Z-X)^2)$, taking $X,Y,Z$ close to each other give some non-trivial and cheap solutions.
For instance $(k+1,k,k)$ for $N=3k$, $(k+1,k+1,k)$ for $N=3k+1$, $(k+1,k,k-1)$ for $N=9k-1$, etc.
</s>