Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import math
  3. import fractions
  4.  
  5. sumnumber = 13195
  6. x = sumnumber
  7.  
  8. while x > 1:
  9.     con1 = (x-1)**(x-1)-1 %x
  10.     con2 = fractions.gcd(3,x)
  11.     con3 = sumnumber % x
  12. #   tilføj lidt debugging:
  13.     print con1 con2 con3
  14.  
  15.     if not (con1 and sumnumber % x) and con3:
  16.         print x
  17.         break  
  18.     x -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement