I need to calculate (X + a)^n mod (n, X^r - 1), where n can be very large.
I use the following code:
R.<x>=PolynomialRing(Integers(n)) pow(x + a, n, X^r - 1)
A better (i.e. faster) solution?
Thanks.
1 | initial version | asked 2012-02-27 07:39:15 +0100 Anonymous |
I need to calculate (X + a)^n mod (n, X^r - 1), where n can be very large.
I use the following code:
R.<x>=PolynomialRing(Integers(n)) pow(x + a, n, X^r - 1)
A better (i.e. faster) solution?
Thanks.
2 | retagged |
I need to calculate (X + a)^n mod (n, X^r - 1), where n can be very large.
I use the following code:
R.<x>=PolynomialRing(Integers(n)) pow(x + a, n, X^r - 1)
A better (i.e. faster) solution?
Thanks.