Guest User

Get A and B from C and N example

a guest
Dec 16th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. from gmpy2 import mpz, isqrt_rem, isqrt, t_div
  4.  
  5. c = mpz(1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139)
  6. n = mpz(14387588531011964456730684619177102985211280936)
  7. #c = mpz(145)
  8. #n = mpz(5)
  9.  
  10. d, e = isqrt_rem(c)
  11. f = abs(e - ((2 * d) + 1))
  12. x = isqrt(((d + n) ** 2) - c) - n
  13. a = d - x
  14. b = t_div(c, a)
  15.  
  16. print("c {}\nn {}\n\nd {}\ne {}\nf {}\nx {}\n\na {}\nb {}".format(c, n, d, e, f, x, a, b))
Add Comment
Please, Sign In to add comment