Power in ℤ/pℤ and in ℤ/pℤ[x]

### 11.8.9 Power in ℤ/pℤ and in ℤ/pℤ[x]

The ^ operator raises modular numbers and polynomials to powers in ℤ/pℤ. (See also Section 7.3.2.) For polynomial expressions, use the normal command to simplify. Xcas uses the binary power algorithm to compute this.

#### Examples

(5%13)^2

| ⎛ ⎝ | −1 | ⎞ ⎠ | %13

normal(((2*x+1)%13)^5)

| ⎛ ⎝ | 6%13 | ⎞ ⎠ | x5+ | ⎛ ⎝ | 2%13 | ⎞ ⎠ | x4+ | ⎛ ⎝ | 2%13 | ⎞ ⎠ | x3+ | ⎛ ⎝ | 1%13 | ⎞ ⎠ | x2+ | ⎛ ⎝ | ⎛ ⎝ | −3 | ⎞ ⎠ | %13 | ⎞ ⎠ | x+1%13

because 10≡ −3 (mod 13 ), 40≡ 1(mod 13 ), 80≡ 2(mod 13 ), 32≡ 6(mod 13 ).