| 1 | initial version |
The problem is that when you write int(P.order()) / int(fac) you make a division between two Python int, which results in a float.
If you write P.order() / fac you will get a rational, which is not good either. What you have to do it to turn this fraction back into an integer with ZZ(P.order() / fac) or int(P.order() / fac)
Note : i did not check your code nor the meaning of the names you gave to objects, but note that the first entry of the primes list is 4 (not a prime).
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.