# Factor

Factorization of an integer is a common tasks in number theory.
NZMATH provides the functionality and some related functions in the `factor` module.

## Factoring

### factor

Factorization of an integer is a common tasks in number theory.
`factor` is the general method in NZMATH.
It takes an integer argument *n*.

- service url:
`http://nzmath-json.appspot.com/factor/methods/factor/`*n*/

Returned value is a list of list, where an inner list consists of a prime and its exponent.

Note that since factorization is the most well-known time consuming task,
the call may time-out.

## Miscellaneous Functions

There are some functions depending on factorization.

### primePowerTest

The first one is `primePowerTest`, which judges whether
*n* is of the form *p*^{k} with a prime *p* or not.

- service url:
`http://nzmath-json.appspot.com/factor/misc/primePowerTest/`*n*/

Returned value is a boolean.

### allDivisors

The function `allDivisors` returns all factors divide *n*.

- service url:
`http://nzmath-json.appspot.com/factor/misc/allDivisors/`*n*/

Returned value is a list of divisors of *n>*.

### primeDivisors

The function `primeDivisors` returns prime factors divide *n*.

- service url:
`http://nzmath-json.appspot.com/factor/misc/primeDivisors/`*n*/

Returned value is a list of prime divisors of *n>*.

### squarePart

The last function `squarePart` returns
the largest integer whose square divides *n*.

- service url:
`http://nzmath-json.appspot.com/factor/misc/squarePart/`*n*/

Returned value is an integer.