Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. If n is small, use trial division.
  2. A simple algorithm that sometimes works for larger integers is the
  3. Pollard p - 1 algorithm from 1974 (see page 150). Input: odd
  4. number n, and bound B:
  5.  
  6. Pollard p - 1 factoring algorithm (n; B)
  7. b := 2
  8. for j := 2 to B do
  9. b := bj mod n
  10. //b congruent 2B! (mod n))
  11. d := gcd(b - 1; n)
  12. if 1 < d < n then
  13. return d
  14. else
  15. return "failure"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement