Section 20.1 Sums of Squares, Once More
ΒΆSubsection 20.1.1 Errors, not just limits
ΒΆAs it happens, we can say something far more specific than just this limit. Recall one of the intermediate steps in our proof.xxxxxxxxxx
def r2(n):
n = prime_to_m_part(n,2)
F = factor(n)
ret = 4
for a,b in F:
if a%4==3:
if b%2==1:
return 0
else:
n = prime_to_m_part(n,a)
else:
ret = ret * (b+1)
return ret
β
def L(n):
ls = []
out = 0
for i in range(1,n+1):
out += r2(i)
ls.append((i,out/i))
return ls
xxxxxxxxxx
def _(n=100):
P = line(L(n))
P += plot(pi+pi*sqrt(2)/sqrt(x),x,3,n,color='red')
P += plot(pi-pi*sqrt(2)/sqrt(x),x,3,n,color='red')
P += plot(pi,x,3,n,color='red',linestyle='--')
show(P)

Subsection 20.1.2 Landau notation
ΒΆIt turns out there is a nice notation for how βbigβ an error is.Definition 20.1.2. Big Oh.
We say that f(x) is O(g(x)) (βeff of eks is Big Oh of gee of eksβ) if there is some positive constant C and some positive number x0 for which
This is known as Landau notation.
Example 20.1.3.
The average number of representations of an integer as a sum of squares is Ο, and if you do the average up to N, then the error will be no worse than some constant times 1/βN. So the sum's error is Big Oh of 1/βN, or O(xβ1/2).
It is unknown in this case just how small the error term really is. In 1906 it was shown that it is O(xβ2/3) (note that this is a more accurate statement, see Exercise 20.6.5). See Figure 20.1.4 for a visual representation, where C=Ο.

It is also known that the error term is not as close as O(xβ3/4); see [C.7.25] for much more information at an accessible level.
Question 20.1.5.
What is the βaverageβ number of divisors of a positive integer? What is the βaverageβ sum of divisors of a positive integer?