Euler Phi in LaTeX (\varphi(n))

φ(n)\varphi(n)
LaTeX command
\varphi(n)
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Euler's totient: how many integers from 1 to n are coprime to n, using the curly phi.

Euler's theorem a^{\varphi(n)} \equiv 1 \pmod n for \gcd(a, n) = 1 and the product formula \varphi(n) = n\prod_{p \mid n}(1 - 1/p) are the standard appearances. \varphi gives the open, looped form, while \phi gives the form with a straight stroke through a circle; both name the same function, and the choice is house style. Many number theory texts pick \varphi so that \phi stays free for other uses, such as the golden ratio or an angle. RSA key generation uses \varphi(pq) = (p-1)(q-1).

Minimal compilable example

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

aφ(n)≡1(modn)a^{\varphi(n)} \equiv 1 \pmod{n}
\documentclass{article}
\begin{document}
Euler Phi: $\varphi(n)$

\[ a^{\varphi(n)} \equiv 1 \pmod{n} \]
\end{document}

Related symbols

All 数論 →

Frequently asked questions

How do I write Euler Phi in LaTeX?
Type \varphi(n) in math mode, for example $a^{\varphi(n)} \equiv 1 \pmod{n}$. It works in plain LaTeX without loading any package.
Which package do I need for \varphi(n)?
None. \varphi(n) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \varphi(n) in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\varphi(n)$ in running text.
Math poweredAIでLaTeXを書く

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

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

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