# Partition function

Symbol: PartitionsP $p(n)$ Integer partition function
$p(n) = \text{A000041}\!\left(n\right)$

## Specific values

Table of $p(n)$ for $0 \le n \le 200$
$p(0) = \# \left\{\left[\right]\right\} = 1$
$p(1) = \# \left\{\left[1\right]\right\} = 1$
$p(2) = \# \left\{\left[2\right], \left[1, 1\right]\right\} = 2$
$p(3) = \# \left\{\left[3\right], \left[2, 1\right], \left[1, 1, 1\right]\right\} = 3$
$p(4) = \# \left\{\left[4\right], \left[3, 1\right], \left[2, 2\right], \left[2, 1, 1\right], \left[1, 1, 1, 1\right]\right\} = 5$
$p\!\left(-n\right) = 0$
Table of $p\!\left({10}^{n}\right)$ to 50 digits for $0 \le n \le 30$

## Generating functions

$\sum_{n=0}^{\infty} p(n) {q}^{n} = \frac{1}{\phi(q)}$

## Sums and recurrence relations

$p(n) = \sum_{k=1}^{n + 1} {\left(-1\right)}^{k + 1} \left(p\!\left(n - \frac{k \left(3 k - 1\right)}{2}\right) + p\!\left(n - \frac{k \left(3 k + 1\right)}{2}\right)\right)$
$p(n) = \frac{1}{n} \sum_{k=0}^{n - 1} \sigma_{1}\!\left(n - k\right) p(k)$

## Congruences

$p\!\left(5 n + 4\right) \equiv 0 \pmod {5}$
$p\!\left(7 n + 5\right) \equiv 0 \pmod {7}$
$p\!\left(11 n + 6\right) \equiv 0 \pmod {11}$

## Inequalities

$p(n) \le p\!\left(n + 1\right)$
$p(n) < p\!\left(n + 1\right)$
$p(n) \ge n$
$p(n) \le {2}^{n}$

## Asymptotic expansions

$p(n) \sim \frac{{e}^{\pi \sqrt{2 n / 3}}}{4 n \sqrt{3}}, \; n \to \infty$

$p(n) = \frac{2 \pi}{{\left(24 n - 1\right)}^{3 / 4}} \sum_{k=1}^{\infty} \frac{A\!\left(n, k\right)}{k} I_{3 / 2}\!\left(\frac{\pi}{k} \sqrt{\frac{2}{3} \left(n - \frac{1}{24}\right)}\right)$
Symbol: HardyRamanujanA $A\!\left(n, k\right)$ Exponential sum in the Hardy-Ramanujan-Rademacher formula
$A\!\left(n, k\right) = \sum_{r=0}^{k - 1} \delta_{(\gcd\left(r, k\right),1)} \exp\!\left(\pi i \left(s\!\left(r, k\right) - \frac{2 n r}{k}\right)\right)$
$\left|p(n) - \frac{2 \pi}{{\left(24 n - 1\right)}^{3 / 4}} \sum_{k=1}^{N} \frac{A\!\left(n, k\right)}{k} I_{3 / 2}\!\left(\frac{\pi}{k} \sqrt{\frac{2}{3} \left(n - \frac{1}{24}\right)}\right)\right| \le \frac{44 {\pi}^{2}}{225 \sqrt{3 N}} + \frac{\pi \sqrt{2}}{75} \sqrt{\frac{N}{n - 1}} \sinh\!\left(\frac{\pi}{N} \sqrt{\frac{2 n}{3}}\right)$

Copyright (C) Fredrik Johansson and contributors. Fungrim is provided under the MIT license. The source code is on GitHub.

2020-04-08 16:14:44.404316 UTC