Powmod - Maple Help

Powmod

inert power function with remainder

 Calling Sequence Powmod(a, n, b, x) Powmod(a, n, b)

Parameters

 a - polynomial in x n - integer b - polynomial in x x - name

Description

 • The Powmod function is a placeholder for representing $\mathrm{Rem}\left({a}^{n},b\right)$ or $\mathrm{Rem}\left({a}^{n},b,x\right)$.  Powmod is more efficient than computing Power(a, n) separately.  It is used in conjunction with either mod or modp1.
 • The call Powmod(a, n, b, x) mod p computes $\mathrm{Rem}\left({a}^{n},b,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}p$. The polynomials a and b must have rational coefficients or coefficients over a finite field specified by RootOfs.
 • The call modp1(Powmod(a, n, b), p) computes $\mathrm{Rem}\left({a}^{n},b\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}p$. The polynomials a and b must be in the modp1 representation and p must be a positive integer.

Examples

 > $\mathrm{Powmod}\left(x,16,{x}^{4}+x+1,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${x}$ (1)
 > $\mathrm{Powmod}\left(x,-5,{x}^{4}+x+1,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${{x}}^{{2}}{+}{x}{+}{1}$ (2)