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 조합론 →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.
Math poweredAI로 LaTeX 작성
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기