Advertisement
Guest User

Gallian c13p57

a guest
Dec 12th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1.  
  2. mods = [7, 8, 12, 14]
  3. for mod in mods:
  4.     for x in range(0, mod):
  5.         xsq = x * x
  6.         xsq %= mod
  7.         fx = -5 * x
  8.         fx %= mod
  9.         total = xsq + fx + 6
  10.         total %= mod
  11.  
  12.         if total == 0:
  13.             print("Z", mod, ": ", x, sep="")
  14.  
  15. # Z7: 2
  16. # Z7: 3
  17. # Z8: 2
  18. # Z8: 3
  19. # Z12: 2
  20. # Z12: 3
  21. # Z12: 6
  22. # Z12: 11
  23. # Z14: 2
  24. # Z14: 3
  25. # Z14: 9
  26. # Z14: 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement