Skip to content

Instantly share code, notes, and snippets.

@Shekharrajak
Created September 4, 2016 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shekharrajak/1d6cbdba4b86993b1c93296a3330d4da to your computer and use it in GitHub Desktop.
Save Shekharrajak/1d6cbdba4b86993b1c93296a3330d4da to your computer and use it in GitHub Desktop.
# code from sympy.diophantine
for solution in solns_pell:
for X_i in [-solution[0], solution[0]]:
for Y_i in [-solution[1], solution[1]]:
s = P*Matrix([X_i, Y_i]) + Q
try:
sol.add(tuple([as_int(_) for _ in s]))
except ValueError:
@Shekharrajak
Copy link
Author

for s in solns_pell:
                sol.add(tuple(s))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment