octree
ToolsTemplatesSymbols
Get Started
octree

Free LaTeX tools and templates for everyone.

Menu

  • Learn
  • About
  • Templates
  • Tools
  • Symbols

Learn

  • Learn LaTeX
  • Learn TikZ
  • Learn PGFPlots
  • View all tutorials →

Tools

  • Image to LaTeX
  • Excel to LaTeX
  • TikZ Generator
  • Image to TikZ
  • LaTeX Preview
  • Markdown to LaTeX
  • Citation Generator
  • AI LaTeX Generator
  • View all tools →

Templates

  • Research Paper
  • PhD Thesis
  • Beamer Presentation
  • Academic CV
  • Cover Letter
  • Lab Report
  • NeurIPS 2026
  • ICML 2026
  • View all 71 templates →

Symbols

  • Greek Letters
  • Math Operators
  • Arrows
  • Relations
  • Set Theory
  • Calculus
  • Logic
  • Linear Algebra
  • Browse all 37 categories →

Open Source

  • Octree Editor
  • Tools & Templates
  • Marketing & Blogs
  • View all repositories →

Socials

  • Instagram
  • LinkedIn
  • TikTok
  • X
  • Reddit
  • Discord

© 2026 Octree. All rights reserved.

Back to Symbols

Number Theory

Divisibility, modular arithmetic, and number-theoretic functions.

Number theory symbols in LaTeX

Divisibility is the symbol people search for most: a \mid b means a divides b, and \nmid (from amssymb) negates it. Use \mid rather than a plain bar so LaTeX treats it as a relation with the right spacing. Congruences use \equiv together with \pmod{n}, which adds the parentheses and spacing for you: a \equiv b \pmod{n}. Inline remainders use \bmod, as in a \bmod n.

The greatest common divisor has its own operator, \gcd(a, b); the least common multiple does not, so write \operatorname{lcm}(a, b) with amsmath. Euler’s totient is \varphi(n) (or \phi(n)), the Möbius function is \mu(n), the divisor function is \sigma(n), and the prime-counting function is \pi(x). Floor and ceiling are \lfloor x \rfloor and \lceil x \rceil, and the Legendre symbol is a fraction in parentheses: \left(\frac{a}{p}\right). Sums over divisors read naturally as \sum_{d \mid n} f(d).

The number sets \mathbb{N}, \mathbb{Z}, \mathbb{Q} and \mathbb{Z}/n\mathbb{Z} need \usepackage{amssymb} (or amsfonts). Read more about blackboard bold in our guide to the real numbers symbol and the overview of mathematical expressions in LaTeX.

Loading...