Integer Part in LaTeX ([x])

[x][x]
LaTeX command
[x]
Package
No package needed: built into LaTeX
Mode
Text and math mode

Where it is used

Square brackets around x, an older notation for the integer part or floor of x.

Classical number theory and many olympiad texts write [x] for the greatest integer not exceeding x, as in Legendre's formula for the exponent of p in n!, which sums [n/p^k] over k \ge 1. Modern writing prefers \lfloor x \rfloor, which is unambiguous, because square brackets also group expressions, denote closed intervals and serve as Iverson brackets. If you keep [x], define it explicitly. For negative numbers, floor and truncation differ: \lfloor -2.5 \rfloor = -3, while truncation toward zero gives -2.

Minimal compilable example

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

∑k≥1[npk]\sum_{k \geq 1} \left[\frac{n}{p^k}\right]
\documentclass{article}
\begin{document}
Integer Part: $[x]$

\[ \sum_{k \geq 1} \left[\frac{n}{p^k}\right] \]
\end{document}

Related symbols

All نظرية الأعداد →

Frequently asked questions

How do I write Integer Part in LaTeX?
Type [x] in math mode, for example $\sum_{k \geq 1} \left[\frac{n}{p^k}\right]$. It works in plain LaTeX without loading any package.
Which package do I need for [x]?
None. [x] is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use [x] in text mode, or only in math mode?
Both. [x] compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث