phi | R Documentation |
Compute Euler's Totient Function (\phi(n)
). Provides the
count of k
integers that are coprime with n
such that
1 \le k \le n
and gcd(n,k) = 1
.
phi(n)
n |
an integer vector. |
An integer vector.
Paul Egeler, MS
"Euler's totient function" (2020) Wikipedia. https://en.wikipedia.org/wiki/Euler%27s_totient_function (Accessed 21 Aug 2020).
gcd
, coprime
, prime_factors
phi(12)
## [1] 4
phi(c(9, 10, 142))
## [1] 6 4 70
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.