[−][src]Function reikna::totient::totient
pub fn totient(n: u64) -> u64
Calculate the value of Euler's totient function for n
.
This function uses Euler's product formula to compute the
totient function. This involves factoring n
, meaning that
the computation of the totient function can take a long time
if n
is a large prime or has a large prime factor.
Examples
use reikna::totient::totient; assert_eq!(totient(17), 16); assert_eq!(totient(36), 12);