Euler's Totient Function φ(n)
Enter an integer n and get the count of integers from 1 to n that are coprime with n, computed by prime factorization: n = 36 returns 12.
φ(n)
—
Euler's totient φ(n)
Euler's totient φ(n) tells you how many integers in [1, n] are coprime with n, meaning they share no prime factor with it. Take a prime p: every smaller positive integer is coprime to it, so φ(p) = p − 1. The function is also multiplicative. When gcd(m, n) = 1, you get φ(m · n) = φ(m) · φ(n). Starting from the prime factorisation n = p₁^a₁ · p₂^a₂ · …, the closed form follows: φ(n) = n · ∏(1 − 1/pᵢ). So φ(12) = 12 · (1 − 1/2) · (1 − 1/3) = 4, which are the integers 1, 5, 7, 11. With two distinct primes it collapses to φ(p · q) = (p − 1)(q − 1), the identity RSA is built on. And Euler's theorem extends Fermat's little theorem: a^φ(n) ≡ 1 (mod n) whenever gcd(a, n) = 1.
Where the totient shows up
- RSA — key generation computes
φ(n) = (p − 1)(q − 1)so it can derive the private exponentd ≡ e^(−1) (mod φ(n)). - Chinese Remainder Theorem (CRT) — speeds up RSA decryption by handling the math modulo
pandqon their own. - Multiplicative order — the order of any element in
(ℤ/nℤ)*always dividesφ(n). - ECDSA and discrete-log systems lean on the totient to describe how big cyclic groups are.
FAQ
Why is φ(n) hard to compute without the factorisation? Pulling φ(n) out of n by itself turns out to be as hard as factoring n, which is the very problem that keeps RSA secure.
What is φ(1)? By convention φ(1) = 1: the only integer in [1, 1] is 1, and gcd(1, 1) = 1.
Is φ(n) always even for n > 2? Yes — there is always either an odd prime factor contributing (p − 1) or a factor of 2 from 2^k.
How does it relate to Carmichael's function? Carmichael's λ(n) is the smallest exponent for which a^λ(n) ≡ 1; it always divides φ(n) and is often preferred in modern RSA implementations.
Related Tools
Euler Totient Function φ(n)
Compute Euler totient φ(n).
Leverett J-Function
Calculates the Leverett J-function, which normalises capillary pressure by interfacial tension, contact angle and the square root of the permeability-to-porosity ratio. It collapses capillary pressure curves from samples with different properties onto a single rock-type curve. Enter the capillary pressure, interfacial tension, contact angle, permeability in millidarcy and porosity.
Savings Income MPC MPS
Computes total and marginal savings from income using MPC and MPS=1-MPC.
Equivalence Ratio (φ)
Calculate the combustion equivalence ratio, φ = AFR_stoichiometric ÷ AFR_actual, dividing the stoichiometric air-fuel ratio by the actual one. The dimensionless result classifies the mixture: φ = 1 is stoichiometric (exact air); φ < 1 is lean (excess air, typical of industrial burners and diesel engines); φ > 1 is rich (lack of air, produces CO and soot, but more power in gasoline engines). The equivalence ratio is the preferred dimensionless parameter in combustion science, linked to excess air (φ = 1/(1+EA)). Enter the stoichiometric and actual air-fuel ratios.
V-Belt Tension Ratio
Calculate the maximum tension ratio of a V-belt at the slip limit, T₁/T₂ = e^(μ·θ ÷ sin β), from the friction coefficient μ, the wrap angle θ (radians) and the pulley groove half-angle β (degrees). This is the Euler-Eytelwein (capstan) equation with the V-belt correction. In a FLAT belt, the limit tension ratio is e^(μθ); but the V-belt has a clever advantage: it fits into a V-shaped GROOVE in the pulley, and when tensioned, is pulled INTO the groove, wedging against the two inclined walls. This WEDGE effect multiplies the normal force (and thus the friction) by a factor 1/sin β — since β is small (typically 17-19°, for a 34-38° groove), sin β is small and the EFFECTIVE friction (μ/sin β) is about 3 times the real friction! That is why V-belts transmit much more power than flat belts of the same size, with lower installation tension (sparing the bearings) and less slip — the reason for their huge popularity in industrial and automotive drives. The limit T₁/T₂ ratio sets the maximum effective tension (and thus power) the belt transmits before slipping. Enter the friction coefficient, the wrap angle and the groove half-angle.
Function Animation
Visualize and animate mathematical functions f(x, t) in real time. The parameter t varies automatically — perfect for waves, trig functions and dynamic equations.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.