# integer_exponent function

The exponent of a prime in a whole number.

## How to write it

### integer_exponent(n, p)

**n**

A whole number. Takes a whole number.

**p**

A prime. Takes a whole number.

## Examples

- $\displaystyle \operatorname{integer\_exponent}(40, 2) = 3$

  `integer_exponent(40, 2)`

  In the solver, `integer_exponent(40, 2)` gives `3`.

  [Open in the solver](https://hilberon.com/?q=integer_exponent%2840%2C%202%29)

## Related functions

- [integer_partitions](https://hilberon.com/library/integer_partitions)

  All the ways to write a whole number as a sum of positive whole numbers.
- [factor_integer](https://hilberon.com/library/factor_integer)

  Prime factorization of a whole number, as a list of prime and exponent pairs.
- [harmonic_number](https://hilberon.com/library/harmonic_number)

  The n-th harmonic number: 1 + 1/2 + ... + 1/n.
- [is_coprime](https://hilberon.com/library/is_coprime)

  Test whether two whole numbers have no common divisor above 1.
- [from_continued_fraction](https://hilberon.com/library/from_continued_fraction)

  The number a continued fraction stands for.
- [is_prime](https://hilberon.com/library/is_prime)

  Test whether a whole number is prime.

---
Source: https://hilberon.com/library/integer_exponent
