Processing math: 100%
Skip to main content

Section 20.1 Sums of Squares, Once More

Our motivational example will be the one we discussed in Section 18.1. Recall that r(n) denotes the (total) number of ways to represent n as a sum of squares, so that r(3)=0 but r(9)=4 and r(5)=8. Then we saw in Fact 18.2.9, more or less rigorously, that

limnβ†’βˆž1nnβˆ‘k=1r(k)=Ο€.

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.

Ο€(1βˆ’βˆš2n+12n)≀1nnβˆ‘k=0r(k)≀π(1+√2n+12n)

Notice that if I subtract the limit, Ο€, from the bounds, I can think of this in terms of an error. Using absolute values, we get, for large enough n,

|1nnβˆ‘k=0r(k)βˆ’Ο€|≀π(√2√n+12n)≀Cnβˆ’1/2

where the value of C is not just Ο€βˆš2, but something a little bigger because of the 12n term.

In the next two cells we set up some functions and then plot the actual number of representations compared with the upper and lower bound implied by this analysis. We include a static image at the end, but encourage you to explore.

Error bounds for average of sum of squares
Figure 20.1.1. Error bounds for average of sum of squares

Note that the actual number is well within the bounding curves given by the red lines, even for small n. This shows a general rule of thumb that, typically, the constant we prove will be a lot bigger than necessary. New research is about improving such bounds.

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

|f(x)|≀Cg(x) for all x>x0.

This is known as Landau notation.

See Exercise Group 20.6.1–5 for some practice with this. In practice in this text, we will focus on C and elide details of x0 unless it is crucial to the narrative.

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=Ο€.

Better bound for average of sum of squares
Figure 20.1.4. Better bound for average of sum of squares

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.

Now let's apply these ideas to the divisor summation functions Ο„ and Οƒ from Definition 19.1.1 in the previous chapter. (We will use these common alternate notations – Ο„ for Οƒ0 and Οƒ for Οƒ1 – from Remark 19.1.2 throughout this chapter.) Namely, consider the following interesting question.

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?

It turns out that clever combinations of many ideas from the course as well as calculus ideas will help us solve these questions! We will start with Ο„ in Section 20.2, and address Οƒ starting in Section 20.4. Finally, answering these questions will motivate us to ask the (much harder) similar questions one can ask about prime numbers, starting in Chapter 21.