Prime Notation in LaTeX (p_n)
- LaTeX command
p_n- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Subscripted p_n naming the n-th prime, so p_1 = 2, p_2 = 3, p_3 = 5.
Sequences of primes are indexed this way in results like Euclid's proof, where p_1 p_2 \cdots p_n + 1 has a prime factor outside the list, and in the asymptotic p_n \sim n\ln n from the prime number theorem. Multi-character subscripts need braces, p_{n+1}, otherwise only the n is lowered. Bertrand's postulate becomes p_{n+1} < 2p_n. The primorial, the product of the first n primes, is often written p_n\#. The prime-counting function \pi(x) is essentially the inverse of n \mapsto p_n.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Prime Notation: $p_n$
\[ p_{n+1} < 2 p_n \]
\end{document}Related symbols
- Perpendicular
\perp - Prime
p - Legendre Symbol
\left(\frac{a}{p}\right) - Phi Function
\phi(n) - Floor
\lfloor x \rfloor - Euler Phi
\varphi(n)
Frequently asked questions
- How do I write Prime Notation in LaTeX?
- Type p_n in math mode, for example $p_{n+1} < 2 p_n$. 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?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $p_n$ in running text.
Math poweredAI로 LaTeX 작성
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기