Number of Divisors in LaTeX (d(n))

d(n)d(n)
LaTeX command
d(n)
Package
No package needed: built into LaTeX
Mode
Text and math mode

Where it is used

Divisor-counting function: how many positive divisors n has.

d(n) = \sum_{d \mid n} 1, so d(12) = 6. For n = p_1^{a_1}\cdots p_k^{a_k}, the formula d(n) = (a_1+1)\cdots(a_k+1) shows it is multiplicative. Other common names are \tau(n) and \sigma_0(n), so check which one your reference uses. Dirichlet's divisor problem studies the average order, \sum_{n \le x} d(n) = x\ln x + (2\gamma - 1)x + O(\sqrt{x}). Watch out: the letter d is also the usual divisor variable inside such sums, so prefer \tau(n) when both would appear in one formula.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

d(n)=∏i=1k(ai+1)d(n) = \prod_{i=1}^{k} (a_i + 1)
\documentclass{article}
\begin{document}
Number of Divisors: $d(n)$

\[ d(n) = \prod_{i=1}^{k} (a_i + 1) \]
\end{document}

Related symbols

All Teori Bilangan →

Frequently asked questions

How do I write Number of Divisors in LaTeX?
Type d(n) in math mode, for example $d(n) = \prod_{i=1}^{k} (a_i + 1)$. It works in plain LaTeX without loading any package.
Which package do I need for d(n)?
None. d(n) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use d(n) in text mode, or only in math mode?
Both. d(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 poweredTulis LaTeX menggunakan AI

Editor LaTeX AI Terbaik, Alternatif Overleaf

Octree membantu peneliti dari 15+ universitas menulis makalah penelitian lebih cepat menggunakan AI

  • Hasilkan diagram TikZ yang indah menggunakan AI
  • Unggah gambar dan konversi ke LaTeX dengan mulus
  • Dapatkan bantuan instan untuk menulis dan memformat makalah penelitian