Double Factorial in LaTeX (n!!)
- LaTeX command
n!!- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Double factorial: the product of all integers from n down to 1 or 2 that share n's parity.
For odd n, n!! = n(n-2)\cdots 3 \cdot 1, so 7!! = 105; for even n, it ends at 2, so 8!! = 384. It is not (n!)!, a frequent misreading, so a short definition helps. Identities include (2n)!! = 2^n n! and (2n-1)!! = \frac{(2n)!}{2^n n!}, which counts perfect matchings on 2n points and appears in Gaussian moments, \mathbb{E}[X^{2n}] = (2n-1)!! for a standard normal. In TeX, ! is a closing symbol, so n!! needs no special spacing. By convention 0!! = (-1)!! = 1.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Double Factorial: $n!!$
\[ (2n-1)!! = \frac{(2n)!}{2^n\, n!} \]
\end{document}Related symbols
All 조합론 →Frequently asked questions
- How do I write Double Factorial in LaTeX?
- Type n!! in math mode, for example $(2n-1)!! = \frac{(2n)!}{2^n\, n!}$. It works in plain LaTeX without loading any package.
- Which package do I need for n!!?
- None. n!! is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use n!! in text mode, or only in math mode?
- Both. 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로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기