FLINT3.7.0-dev

fmpz_euler_phi

Synopsis#include <flint/fmpz.h>
void fmpz_euler_phi(fmpz_t res, const fmpz_t n)source

Sets res to Euler's totient φ(n)\varphi(n), the number of 1≤k≤n1 \le k \le n with gcd⁡(k,n)=1\gcd(k, n) = 1, and to 0 for n≤0n \le 0. Word-size nn use n_euler_phi; larger nn are factored. The function fmpz_factor_euler_phi of fmpz_factor takes a factorisation.

Cite this page

The FLINT team, “fmpz_euler_phi (fmpz.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz/fmpz_euler_phi.html (generated 2026-11-02).