Section 20.3 Digging Deeper and Finding Limits
¶
Subsection 20.3.1 Moving toward a proof
¶To be more in line with our previous notation, we will say that τ(n) is exactly given by the number of positive integer points (d,nd) with the property that dnd=n. Now we can interpret ∑nk=1τ(k) as the number of lattice points on or under the hyperbola y=n/x. This is a completely different way of thinking of the divisor function! We can see it for various sizes in the interact below.xxxxxxxxxx
def _(n=(15,list(range(2,50)))):
viewsize=n+1
g(x)=1/x
P=Graphics()
P += plot(n*g,(x,0,n+1))
P += plot(2*g,(x,0,n+1), linestyle="--")
if n>7:
P += plot((n-5)*g,(x,0,n+1),linestyle="--")
grid_pts = [[i,j] for i in [1..viewsize] for j in [1..viewsize]]
P += points(grid_pts,rgbcolor=(0,0,0),pointsize=2)
lattice_pts = [coords for coords in grid_pts if (coords[0]*coords[1]<=n)]
P += points(lattice_pts, rgbcolor = (0,0,1),pointsize=20)
show(P,ymax=viewsize,aspect_ratio=1)

We can think of it as ∑nk=1τ(k) – adding up the lattice points along each hyperbola.
We can think of it as ∑nj=1⌊nk⌋, or adding up the lattice points in each vertical column.
Definition 20.3.3.
Throughout this text we use log(n) to mean the natural logarithm with base e.

All the areas where the red squares are above the hyperbola add up to less than n, because they are all 1 in width or less, and do not intersect vertically (they stack, as it were).
Similarly, all the areas where the hyperbola is higher add up to less than n, because they are all 1 in height or less, and are horizontally non-intersecting.
xxxxxxxxxx
def _(n=(8,list(range(2,25)))):
viewsize=n+1
g(x)=1/x
P1 = Graphics()
P1 += plot(n*g,(x,1,n), ymax=viewsize, aspect_ratio=1, xmin=0, xmax=n+1)
P1 += plot(piecewise([[(j,j+1),floor(n/j)] for j in [1..n-1]]), (x,1,n), fill=n/x,fillalpha=.3, linestyle='') + plot(1,(x,n,n+1),fill=True, fillalpha=.3,linestyle='')
P2 = plot(n*g,(x,0,n+1), ymax=viewsize, aspect_ratio=1)
P2 += plot(n*g,(x,1,n),fill=True,fillalpha=.3)
grid_pts = [[i,j] for i in [1..viewsize] for j in [1..viewsize]]
P1 += points(grid_pts,rgbcolor=(0,0,0),pointsize=2)
P2 += points(grid_pts,rgbcolor=(0,0,0),pointsize=2)
lattice_pts = [coords for coords in grid_pts if (coords[0]*coords[1]<=n)]
P1 += points(lattice_pts, rgbcolor = (0,0,1),pointsize=20)
P2 += points(lattice_pts, rgbcolor = (0,0,1),pointsize=20)
squares=[line([[k,l],[k+1,l],[k+1,l-1],[k,l-1],[k,l]], rgbcolor=(1,0,0)) for [k,l] in lattice_pts]
for object in squares:
P1 += object
P2 += object
show(graphics_array([P1,P2]))
pretty_print(html(r"Error between average of $\tau(%s)$ and $%s\log(%s)$"%(n,n,n)))
Fact 20.3.5.
The error ∑nk=1τ(k)−nlog(n) is a positive real number less than n minus a (different positive real) number less than n.
So the error is certainly O(n) (less than some multiple of n as n gets huge).
-
So, the error in the average is less than some constant as n gets huge! I.e.,
1nn∑k=1τ(k)−log(n)=O(1)
(Recall we use log(n) to mean the natural logarithm.)


Subsection 20.3.2 Getting a handle on error
¶To answer this, we will try one more geometric trick.
The ones on the line y=x.
The lattice points above the line and below the hyperbola.
The lattice points to the right of the line and below the hyperbola.
xxxxxxxxxx
def _(n=(8,list(range(2,25)))):
viewsize=n+1
g(x)=1/x
P=Graphics()
P += plot(n*g,(x,0,n+1))
P += plot(2*g,(x,0,n+1),linestyle="--")
if n>7:
P += plot((n-5)*g,(x,0,n+1),linestyle="--")
grid_pts = [[i,j] for i in [1..viewsize] for j in [1..viewsize]]
P += points(grid_pts, rgbcolor=(0,0,0),pointsize=2)
lattice_pts = [coords for coords in grid_pts if (coords[0]*coords[1]<=n)]
P += points(lattice_pts, rgbcolor = (0,0,1),pointsize=20)
P += plot(x,(x,0,viewsize), linestyle="--",rgbcolor=(0,0,0))
show(P,ymax=viewsize,aspect_ratio=1)
Subsection 20.3.3 The end of the story
¶We're almost at the end of the story! It's been a while since we explored the long-term average of τ in Subsection 20.2.1; at that point, you likely convinced yourself that log(n) is close to the average value of τ. So now we just need to relate the sum 2∑d≤√n1d−1 to log(n). I wish to emphasize just how small the error term O(1/√n) is!
Definition 20.3.10.
The number γ, or the Euler-Mascheroni constant, is defined by
Remark 20.3.11.
You have almost certainly never heard of this number, but it is very important. There is even an entire book, by Julian Havil [C.4.15] about this number. It's a pretty good book, in fact!
Among other crazy properties, γ is the derivative of a generalization of the factorial function, called Gamma (Γ). I am not making this up.
Most baffling of all, γ is not known to be either rational or irrational. Maybe you will solve this mystery?
