Previous Up Next

6.35.10  Calcul de an mod p ou de A(x)n mod P(x),p: powmod powermod

On tape :

powmod(x+1,17,5,x^4+x+1)

On obtient :

-x^3-x^2

On a en effet :

rem((x+1)^17,x^4+x+1)

qui renvoie :
29144*x^3+36519*x^2+12270*x-4185 et
(29144*x^3+36519*x^2+12270*x-4185)% 5 qui renvoie :
(-1 % 5)*x^3+(-1 % 5)*x^2
et
((-1 % 5)*x^3+(-1 % 5)*x^2)% 0
qui renvoie :
-x^3-x^2
Remarque (cf section 6.35.9)
Si on peut calculer une puissance dans ℤ/pℤ on tape par exemple :
:

(5% 13)^21)

On obtient :

5% 13

On tape :

(5% 8)^21)

On obtient :

-3% 8

Previous Up Next