Partition in LaTeX (p(n))
- LaTeX command
p(n)- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Partition function p(n): the number of ways to write n as a sum of positive integers, ignoring order.
For example, p(4) = 5 because 4 = 3+1 = 2+2 = 2+1+1 = 1+1+1+1. Euler's generating function is \sum_n p(n) x^n = \prod_{k \geq 1} \frac{1}{1 - x^k}, and Hardy and Ramanujan found the asymptotic p(n) \sim \frac{1}{4n\sqrt{3}} e^{\pi\sqrt{2n/3}}. Ramanujan's congruences include p(5k+4) \equiv 0 \pmod 5. The lowercase p clashes with probability density notation and with primes, so define it in mixed contexts. Restricted versions are written p_k(n) or p(n, k) for partitions into at most k parts.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Partition: $p(n)$
\[ \sum_{n \geq 0} p(n)\, x^n = \prod_{k=1}^{\infty} \frac{1}{1 - x^k} \]
\end{document}Related symbols
All Kombinatorik →Frequently asked questions
- How do I write Partition in LaTeX?
- Type p(n) in math mode, for example $\sum_{n \geq 0} p(n)\, x^n = \prod_{k=1}^{\infty} \frac{1}{1 - x^k}$. It works in plain LaTeX without loading any package.
- Which package do I need for p(n)?
- None. p(n) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use p(n) in text mode, or only in math mode?
- Both. p(n) compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI
- Jana diagram TikZ yang cantik menggunakan AI
- Muat naik imej dan tukar ke LaTeX dengan lancar
- Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan