mathlib documentation

data.​nat.​totient

data.​nat.​totient

def nat.​totient  :
ℕ → ℕ

Euler's totient function. This counts the number of positive integers less than n which are coprime with n.

Equations
@[simp]
theorem nat.​totient_zero  :

theorem nat.​totient_le (n : ℕ) :

theorem nat.​totient_pos {n : ℕ} :
0 < n → 0 < n.totient

theorem nat.​sum_totient (n : ℕ) :
(finset.filter (λ (_x : ℕ), _x ∣ n) (finset.range n.succ)).sum (λ (m : ℕ), m.totient) = n