Fermat's factorization method: Difference between revisions

Content deleted Content added
Corrected pseudocode (a should be incremented first)
Line 16:
::Bsq ← A*A - N
::while Bsq isn't a square:
:::Bsq ← A*A - N // equivalently: Bsq ← Bsq + 2*A -+ 1
:::A ← A + 1
:::Bsq ← A*A - N // equivalently: Bsq ← Bsq + 2*A - 1
::endwhile
::return A - sqrt(Bsq) // or A + sqrt(Bsq)