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 数論 →

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 poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得