| 1 | initial version |
The explanation is that solve_diophantine simply calls sympy's diophantine, which ignores all assumptions.
So you will have to filter manually:
sage: var('n,k')
sage: eqn = n^2 - (k^2 + k) == 30
sage: [(n0, k0) for (n0, k0) in solve_diophantine(eqn, (n,k)) if n0 > 0 and k0 > 0 and n0 > k0]
[(6, 2), (30, 29)]
Filtering could be added as a post-processing step in solve_diophantine, so you could open an issue for that.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.