Phi Function in LaTeX (\phi(n))

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

Where it is used

Euler's totient written with the straight-stroke phi rather than the curly variant.

Many textbooks write the totient as \phi(n), for instance \phi(p) = p - 1 for a prime p and \phi(p^k) = p^k - p^{k-1}. In the default Computer Modern font, \phi is a circle crossed by a vertical stroke, whereas \varphi is the looped form. Both denote the same function, so choose one and stay consistent. If the golden ratio, an angle or a potential also appears, reserve \phi for one meaning and \varphi for the other. Multiplicativity, \phi(mn) = \phi(m)\phi(n) for coprime m and n, is a common display.

Minimal compilable example

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

ϕ(mn)=ϕ(m) ϕ(n)\phi(mn) = \phi(m)\,\phi(n)
\documentclass{article}
\begin{document}
Phi Function: $\phi(n)$

\[ \phi(mn) = \phi(m)\,\phi(n) \]
\end{document}

Related symbols

All Number Theory →

Frequently asked questions

How do I write Phi Function in LaTeX?
Type \phi(n) in math mode, for example $\phi(mn) = \phi(m)\,\phi(n)$. It works in plain LaTeX without loading any package.
Which package do I need for \phi(n)?
None. \phi(n) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \phi(n) in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\phi(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