ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 27 Feb 2012 07:39:15 +0100Power of a polynomial mod (n, X^r - 1)https://ask.sagemath.org/question/8742/power-of-a-polynomial-mod-n-xr-1/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.mcl1962Mon, 27 Feb 2012 07:39:15 +0100https://ask.sagemath.org/question/8742/