To compute a to the power n in ℤ/pℤ, we use the operator
^. Xcas implementation is the binary power algorithm.
Input :
^2Output :
To compute A to the power n in ℤ/pℤ[x], we use the operator
^ and the normal command .
Input :
^5)Output :
^5+(2%13)*x^4+(2%13)*x^3+(1%13)*x^2+(-3%13)*x+1%13because 10=−3 (mod 13), 40=1 (mod 13), 80=2 (mod 13), 32=6 (mod 13).