Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Power of a polynomial mod (n, X^r - 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.

Power of a polynomial mod (n, X^r - 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.