Partition in LaTeX (p(n))
- LaTeX command
p(n)- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Try Partition in a real LaTeX document
Open a ready-to-compile document that already uses p(n), with the right packages loaded. Edit it and see the PDF, no install needed.
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.
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث