# Decomposition into prime factors: ifactor

### 5.5.4 Decomposition into prime factors: ifactor

The ifactor command factors an integer into its prime factors. (Note that a prime factor of a Gaussian integer is only determined up to a factor of ±1 or ± i.)

- ifactor takes one argument:
  n, an integer or a list of integers.
- ifactor(n) returns n in factored form (or a list of the integers in factored form).

#### Examples.

- Input:
  ifactor(90)
  Output:

  5· 2· 32

- Input:
  ifactor(-90)
  Output:

  −5· 2· 32

- Input:
  ifactor(14+23*i)
  Output:

  i | ⎛ ⎝ | 2−i | ⎞ ⎠ | 2 | ⎛ ⎝ | 5+2 i | ⎞ ⎠

- Input:
  ifactor([36,52])
  Output:

  | ⎡ ⎣ | 22· 32,13· 22 | ⎤ ⎦