Fermat's factorization method: Difference between revisions

Content deleted Content added
I flipped the order of the lines: Bsq ← A*A - N // equivalently: Bsq ← Bsq + 2*A + 1 :::and::: A ← A + 1
Line flipping broke the equivalence, it should have - 1 now instead of + 2
Line 17:
::while Bsq isn't a square:
:::A ← A + 1
:::Bsq ← A*A - N // equivalently: Bsq ← Bsq + 2*A +- 1
::endwhile
::return A - sqrt(Bsq) // or A + sqrt(Bsq)