| 1 | initial version |
What you are telling Sage with the code snippet is a polynomial whose coefficients are in Z/3Z, but you want a symbolic expression where the variable x is integer and whose values are in Z/3Z, or in other words, modulo 3.
sage: assume(x, "integer")
sage: (x^3).mod(3)
x^3
That would be the most natural way to express it but, as you see, the result is wrong. The Pari-style alternative Mod function only accepts numeric input.
Note that with noninteger x the result wold not be x but -3*floor(x^3/3)+x^3.
I have opened a ticket at trac #17417.
| 2 | No.2 Revision |
What you are telling Sage with the code snippet is a polynomial whose coefficients are in Z/3Z, but you want a symbolic expression where the variable x is integer and whose values are in Z/3Z, or in other words, modulo 3.
sage: assume(x, "integer")
sage: (x^3).mod(3)
x^3
That would be the most natural way to express it but, as you see, the result is wrong. The Pari-style alternative Mod function only accepts numeric input.
Note that with noninteger x the result wold not be x but -3*floor(x^3/3)+x^3.
I have opened a EDIT:
There is an old ticket at trac #17417#9935. that is a prerequisite for such simplifications.
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.