Julia version of preliminary chakravala algorithm with squarefree improvement.