Section 18.1 Three Questions for Euler phi
xxxxxxxxxx
euler_phi(25)
Subsection 18.1.1 Formulas
Of course, such small values can be calculated by hand. But what about larger ones? Surely we don't want to have to check every number up toxxxxxxxxxx
print(factor(275))
print(euler_phi(275))
print(275*(1-1/5)*(1-1/11))
Fact 18.1.1.
If
Proof.
Do Exercise 9.6.11!
Subsection 18.1.2 Relations
One piece of getting a formula forDefinition 18.1.2.
We say that
xxxxxxxxxx
def _(a=25,b=11):
pretty_print(html(r"$\phi(%s)=%s\text{ and }\phi(%s)=%s$"%(a, euler_phi(a), b, euler_phi(b))))
if gcd(a,b)==1:
pretty_print(html(r"And $\phi(%s\cdot %s)=%s\cdot %s=%s$, their product!"%(a, b, euler_phi(a), euler_phi(b), euler_phi(a*b))))
else:
pretty_print(html(r"But $%s$ and $%s$ aren't coprime, so $\phi(%s\cdot %s)=%s\neq %s\cdot %s$"%(a, b, a, b, euler_phi(a*b), euler_phi(a), euler_phi(b))))
Subsection 18.1.3 Summation (and limits)
One thing that might be useful to look at in a function is its behavior in the long term. In calculus, we certainly talk a lot about things like asymptotes, even asymptotes other than horizontal and vertical ones. Unfortunately, arithmetic functions don't often look that great in this way. For instance, let's look at the plot of
plot(euler_phi,1,100)
)xxxxxxxxxx
def _(n=275):
pretty_print(html("$%s$ factors as $%s$"%(n,latex(factor(n)))))
pretty_print(html("Its divisors are $%s$"%latex(divisors(n))))
pretty_print(html(r"The sum of $\phi$ of the divisors is $%s$"%sum([euler_phi(d) for d in divisors(n)])))