galois.euler_totient

galois.euler_totient(n)[source]

Implements the Euler Totient function to count the positive integers (totatives) in 1 <= k < n that are relatively prime to n, i.e. gcd(n, k) = 1.

Parameters

n (int) – A positive integer.

Returns

The number of totatives that are relatively prime to n.

Return type

int