Euler's Totient Function

Number Theory Fundamentals · 4:19

Listen on 93

Lyrics

[Verse 1]
When you have a number n and want to know
How many friends below it share no common flow
Count the ones that share no factors, standing proud and free
That's what Euler's function shows, phi of n you see

[Chorus]
Phi of n, count them all
Numbers that are coprime, standing tall
Greatest common divisor equals one
Phi of n, the counting's done
Multiply the primes away
One minus one over p, that's the way

[Verse 2]
If your number is a prime, the answer's crystal clear
Take that prime and minus one, the count will appear
Seven gives you six, eleven gives you ten
All the numbers below prime p are friends again

[Chorus]
Phi of n, count them all
Numbers that are coprime, standing tall
Greatest common divisor equals one
Phi of n, the counting's done
Multiply the primes away
One minus one over p, that's the way

[Verse 3]
When you've got a prime to power, p to the k
Take p to the k minus p to k minus one, don't make mistake
Or use the formula clean, p to k times one minus one over p
Factor out the common theme, makes the math so free

[Bridge]
Twelve has factors two and three
Twelve times one half times two thirds, you see
Twelve times one half is six
Times two thirds gives four, the magic tricks
One, five, seven, eleven share no factors with twelve
Coprime counting on the shelves

[Chorus]
Phi of n, count them all
Numbers that are coprime, standing tall
Greatest common divisor equals one
Phi of n, the counting's done
Multiply the primes away
One minus one over p, that's the way

[Verse 4]
If two numbers share no factors, multiplicative it stays
Phi of m times phi of n when gcd is one always
Break your number down to primes, apply the formula neat
N times product of one minus one over p makes it complete

[Outro]
From one to n, count the friends
Where the greatest common divisor is one
Euler's totient never ends
Phi of n, the counting's done

← The Chinese Remainder Theorem | Fermat's Little Theorem →