Section 20.2 Average of Tau
ΒΆSubsection 20.2.1 Beginnings
ΒΆLet's begin by observing Figure 20.2.1, which plots the average for Ο up to n=100.
Sage note 20.2.2. Try to be efficient.
Observe the following two cells. The first cell records the successive sums of Ο in a variable out
(for βoutputβ), so that we don't have to recalculate the entire sum each time we compute the average value for a different input value. We record the actual averages sequentially in a separate list ls
.
Then the interactive cell is very simple indeed. Try being efficient in your programming!
xxxxxxxxxx
def L(n):
ls = []
out = 0
for i in range(1,n+1):
out += sigma(i,0)
ls.append((i,out/i))
return ls
xxxxxxxxxx
def _(n=100):
P = line(L(n))
show(P)
xxxxxxxxxx
def _(n=100,C=.5,f=[x^(1/2), x, x^(1/3), x^(1/4), log(x), log(log(x)), x^(1.5), x^2]):
f(x) = f
P = line(L(n),legend_label=r'average of $\tau$')
P += plot(C*f,(x,1,n), color='black', linestyle='--', legend_label='$%s%s$'%(RDF(C),latex(f(x))))
show(P)

Subsection 20.2.2 Heuristics for tau
ΒΆWe'll start with a heuristic, going right back to the sieve of Eratosthenes. In that algorithm (6.2.2), we proved that in order to test whether n is prime, you just have to check all numbers up through βn. This is because any divisor βn<d<n implies the existence of a divisor nd such thatExample 20.2.4.
For n=24 this idea is actually true. We can line these up in pairs as (1,24), (2,12), (3,8), (4,6), and that gives 2β ββ24β=8 total divisors.
Subsection 20.2.3 Using sums to get closer
ΒΆLet's rewrite this inequality in a more suggestive form by noting k=n(k/n):Subsection 20.2.4 But Big-Oh isn't enough
ΒΆHowever, we might also want to know what the average value of Ο is. The preceding subsections only tell us what it's less than! In the next interact, it seems that it's hard to find the βrightβ value of C so that the average value would be the same order as βn.xxxxxxxxxx
def L(n):
ls = []
out = 0
for i in range(1,n+1):
out += sigma(i,0)
ls.append((i,out/i))
return ls
β
P = line(L(1000000))
β
def _(a=.02,n=2):
show(P + plot(a*x^(1/n), (x,1,10^6), color='red',linestyle='--'))
pretty_print(html(r"Blue is the average value of $\tau$"))
pretty_print(html("Red is $%sx^{1/%s}$"%(a,n)))
First, note that Ο is multiplicative.
-
For a given prime p, note that Ο(px)=x+1 grows much more slowly than (px)1/3=px/3, which is exponential in x.
What value do each of these have at x=0?
Take derivatives of both functions at x=0 to show that the growth statement is definitely true for pβ₯23.
Show that for each prime p less than 23 there is an xp such that the growth statement is true after xp.
Put these pieces of information together to show that Ο is O(x1/3).