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 Number Theory →

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 poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers