factorization of an integer $N$ that is in special format
If $p_0$ and $q_0$ are known then so are $p_i$ and $q_i$ by iterating.  

To factor $N$, do the following: 


$(p,q) \gets (p_0,q_0)$
while ($p \nmid N$) do $(p,q) \gets (next\_prime(p^2+q^2), next\_prime(2pq))$
Return $(p,q)$