Original sentence: FermatFactor(N): // N should be odd.a ← a + 1.a ← ceil(sqrt(N)).b2 ← a*a - N.b2 ← a*a - N // equivalently: b2 ← b2 + 2*a - 1.return a - sqrt(b2) // or a + sqrt(b2).while b2 isn't a square: