Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import math
- import fractions
- sumnumber = 13195
- x = sumnumber
- while x > 1:
- con1 = (x-1)**(x-1)-1 %x
- con2 = fractions.gcd(3,x)
- con3 = sumnumber % x
- # tilføj lidt debugging:
- print con1 con2 con3
- if not (con1 and sumnumber % x) and con3:
- print x
- break
- x -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement