try ai
Popular Science
Edit
Share
Feedback
  • Lagrange's Four-Square Theorem

Lagrange's Four-Square Theorem

SciencePediaSciencePedia
Key Takeaways
  • Lagrange's four-square theorem guarantees that any non-negative integer can be expressed as the sum of four integer squares.
  • Jacobi's four-square theorem provides an exact formula for the number of representations, connecting the additive problem to the number's divisors.
  • The theorem is supported by deep structures in different mathematical fields, including Hamilton's quaternions, analytic theta functions, and the geometry of numbers.
  • The sum of four squares has profound applications in analysis, physics (via lattice sums), and probability theory, connecting number theory to other sciences.

Introduction

The statement that any positive integer can be written as the sum of four integer squares is a landmark result in number theory, known as Lagrange's four-square theorem. While simple to state, this fact raises profound questions: Why is the number four so special? Is this merely a numerical curiosity, or does it hint at deeper mathematical truths? This article addresses this gap, moving beyond a simple declaration of the theorem to explore its rich theoretical underpinnings. The reader will embark on a journey through the principles and mechanisms that make this theorem true, examining it through the lenses of algebra, analysis, and geometry. Following this, we will explore the theorem's far-reaching impact by investigating its diverse applications and interdisciplinary connections, revealing how this concept from pure mathematics provides powerful tools for physics and probability theory.

Principles and Mechanisms

After learning that every integer can be written as a sum of four squares, a curious mind immediately starts to bubble with questions. Why four? Why not three, or five? Is there only one way to do it for each number, or many? And if there are many, is there any pattern to them? Most importantly, why is this true? Is it just a quirky accident of numbers, or is it a sign of something deeper, a shadow of a more profound structure hiding in the background?

Let’s embark on a journey to answer these questions. We won’t just state the facts; we’ll try to understand the machinery behind them, to see how mathematicians with different tastes—the algebraist, the analyst, the geometer—all found their own beautiful reasons for this remarkable theorem.

The Magic Number Four

First, why is four the magic number? Let's see why smaller numbers of squares won't do the job.

With ​​one square​​, it's obvious we can only represent perfect squares: 0,1,4,9,…0, 1, 4, 9, \dots0,1,4,9,…. Most numbers are left out.

With ​​two squares​​, we do much better. We can get 2=12+122=1^2+1^22=12+12, 5=12+225=1^2+2^25=12+22, 8=22+228=2^2+2^28=22+22, and so on. But we still miss many numbers, like 3,6,7,113, 6, 7, 113,6,7,11. There is a beautiful, precise rule for which numbers can be written as a sum of two squares (discovered by Pierre de Fermat), but the bottom line is, two is not enough.

What about ​​three squares​​? We get even closer! We can now represent 3=12+12+123=1^2+1^2+1^23=12+12+12 and 6=22+12+126=2^2+1^2+1^26=22+12+12. It seems like we might just make it. But a simple, elegant argument shows that we will always fall short. Let’s look at numbers not in their full glory, but just their remainders when divided by 8—a technique we call ​​modular arithmetic​​.

Any integer square, when you divide it by 8, leaves a remainder of only 0, 1, or 4. Try it: 02=00^2=002=0, 12=11^2=112=1, 22=42^2=422=4, 32=9≡1(mod8)3^2=9 \equiv 1 \pmod{8}32=9≡1(mod8), 42=16≡0(mod8)4^2=16 \equiv 0 \pmod{8}42=16≡0(mod8), and so on. The pattern repeats. So, the only possible remainders are 0,1,40, 1, 40,1,4.

Now, try to add any three of these remainders together. 1+1+1=31+1+1 = 31+1+1=3 1+1+0=21+1+0 = 21+1+0=2 4+1+0=54+1+0 = 54+1+0=5 4+4+1=9≡1(mod8)4+4+1 = 9 \equiv 1 \pmod{8}4+4+1=9≡1(mod8) ...and so on. No matter how you combine three numbers from the set {0,1,4}\{0, 1, 4\}{0,1,4}, you will never get a sum of 7. This means that any integer which leaves a remainder of 7 when divided by 8 (like 7, 15, 23, 31, ...) can never be written as a sum of three squares. This single, unbreachable "congruence obstruction" proves that three squares are not enough to represent every integer. From this perspective, the quadratic form Q(x,y,z)=x2+y2+z2Q(x,y,z)=x^2+y^2+z^2Q(x,y,z)=x2+y2+z2 is not ​​universal​​.

Then, like a miracle, adding a ​​fourth square​​ solves the problem completely. Every single non-negative integer, without exception, can be written as a sum of four squares. Lagrange's theorem tells us there are no gaps, no exceptions. The number 4 is special because it is the smallest number of squares for which no such congruence obstructions exist. This is what we mean when we say, in the language of Waring's problem, that g(2)=4g(2)=4g(2)=4.

A Guarantee of Existence, Not Uniqueness

So, a representation as a sum of four squares is always possible. But is it unique? Let's take a simple example, say n=2n=2n=2. We can write it as 12+12+02+021^2+1^2+0^2+0^212+12+02+02. This corresponds to the 4-tuple of integers (1,1,0,0)(1,1,0,0)(1,1,0,0). But we could also write it as (−1)2+12+02+02(-1)^2+1^2+0^2+0^2(−1)2+12+02+02, which gives the tuple (−1,1,0,0)(-1,1,0,0)(−1,1,0,0). Or we could change the order, giving (1,0,1,0)(1,0,1,0)(1,0,1,0).

Clearly, for a single number nnn, there can be many different tuples (a,b,c,d)(a,b,c,d)(a,b,c,d) that satisfy n=a2+b2+c2+d2n = a^2+b^2+c^2+d^2n=a2+b2+c2+d2. This means that the rule that maps an integer nnn to "its" four-square representation is not a mathematical ​​function​​, because a function must give a single, unique output for each input. The theorem guarantees existence, not uniqueness. This opens up a fascinating new question: if there are multiple ways, how many ways are there?

Counting the Ways: An Unexpected Order

At first, counting the number of representations for an integer nnn seems like a messy, chaotic business. The number of representations for n=1n=1n=1 is 8 (from (±1,0,0,0)(\pm 1, 0, 0, 0)(±1,0,0,0) and its permutations). For n=2n=2n=2, it's 24. For n=3n=3n=3, it's 32. Is there any rhyme or reason to this sequence?

The answer, discovered by Carl Gustav Jacob Jacobi, is breathtaking. The number of representations, which we call r4(n)r_4(n)r4​(n), is not chaotic at all. It is governed by a simple, elegant arithmetic rule. Jacobi's four-square theorem states that:

r4(n)=8∑d∣n4∤ddr_4(n) = 8 \sum_{\substack{d|n \\ 4 \nmid d}} dr4​(n)=8d∣n4∤d​∑​d

Let's unpack this. The formula tells us to find all the positive divisors ddd of our number nnn. Then, we filter out any of those divisors that are multiples of 4. Finally, we add up the remaining divisors and multiply the result by 8. That's it. That's the number of ways.

Let's try it for a number like n=5n=5n=5. The divisors of 5 are just 1 and 5. Neither is a multiple of 4. So the sum is 1+5=61+5 = 61+5=6. The formula gives r4(5)=8×6=48r_4(5) = 8 \times 6 = 48r4​(5)=8×6=48. There are 48 different integer 4-tuples (a,b,c,d)(a,b,c,d)(a,b,c,d) whose squares sum to 5! This comes from representations like (±2)2+(±1)2+02+02(\pm 2)^2+(\pm 1)^2+0^2+0^2(±2)2+(±1)2+02+02 and all their permutations.

For n=30n=30n=30, the divisors are 1,2,3,5,6,10,15,301, 2, 3, 5, 6, 10, 15, 301,2,3,5,6,10,15,30. None are multiples of 4. Their sum is 1+2+3+5+6+10+15+30=721+2+3+5+6+10+15+30=721+2+3+5+6+10+15+30=72. So, r4(30)=8×72=576r_4(30) = 8 \times 72 = 576r4​(30)=8×72=576. An astonishing number of ways!

This formula is a gem. It reveals a shocking and profound connection between an "additive" problem (summing squares) and a "multiplicative" one (finding divisors). Why on earth should these two be related? To find out, we must dig deeper.

The Deep Structures Beneath the Surface

The fact that four-square representations have such a neat counting formula, and that the set of sums-of-four-squares is closed under multiplication (a fact we'll see next), suggests this isn't a fluke. It's a sign that we are looking at a shadow of a more majestic mathematical object. Let's look at this object from three different angles.

The Algebraic Key: Hamilton's Quaternions

You may have encountered complex numbers, a+bia+bia+bi. They have a wonderful property related to sums of two squares. The "norm" or squared magnitude of a complex number is ∣a+bi∣2=a2+b2|a+bi|^2 = a^2+b^2∣a+bi∣2=a2+b2. If you multiply two complex numbers, their norms multiply: ∣z1z2∣=∣z1∣∣z2∣|z_1 z_2| = |z_1| |z_2|∣z1​z2​∣=∣z1​∣∣z2​∣. This leads directly to Brahmagupta's identity: (a2+b2)(c2+d2)=(ac−bd)2+(ad+bc)2(a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2(a2+b2)(c2+d2)=(ac−bd)2+(ad+bc)2 This shows that the product of two numbers that are sums of two squares is itself a sum of two squares.

This begs the question: is there a similar algebraic structure behind sums of four squares? The answer is yes. In the 1840s, William Rowan Hamilton discovered the ​​quaternions​​. These are numbers of the form a+bi+cj+dka+bi+cj+dka+bi+cj+dk, where i,j,ki,j,ki,j,k are new kinds of imaginary units. Just as with complex numbers, quaternions have a norm: N(a+bi+cj+dk)=a2+b2+c2+d2N(a+bi+cj+dk) = a^2+b^2+c^2+d^2N(a+bi+cj+dk)=a2+b2+c2+d2. And, crucially, this norm is multiplicative: N(q1q2)=N(q1)N(q2)N(q_1 q_2) = N(q_1) N(q_2)N(q1​q2​)=N(q1​)N(q2​).

This multiplicative norm gives us Euler's four-square identity, a bigger cousin of Brahmagupta's identity. It shows that the product of two sums of four squares is always another sum of four squares. This implies that the set of sums of four squares is multiplicatively closed, a property that holds not just for integers but in any commutative ring! This algebraic fact is tremendously powerful. It tells us that if we can prove that all prime numbers are sums of four squares, then all other integers must be as well, because any integer is just a product of primes. The quaternions provide the hidden algebraic scaffolding that holds Lagrange's theorem together.

The Analytic Key: The Theta Function "Machine"

Let's try a completely different approach, one favored by the analyst. Imagine you want to build a "machine" that catalogs all the possible ways to form sums of squares. A generating function is such a machine. Consider this infinite polynomial (a power series): θ3(q)=∑k=−∞∞qk2=1+2q12+2q22+2q32+⋯=1+2q+2q4+2q9+…\theta_3(q) = \sum_{k=-\infty}^{\infty} q^{k^2} = 1 + 2q^{1^2} + 2q^{2^2} + 2q^{3^2} + \dots = 1 + 2q + 2q^4 + 2q^9 + \dotsθ3​(q)=∑k=−∞∞​qk2=1+2q12+2q22+2q32+⋯=1+2q+2q4+2q9+… This is a ​​theta function​​. Think of it as a catalog where the exponent of qqq tells you a square number.

What happens if we raise this entire series to the fourth power, (θ3(q))4(\theta_3(q))^4(θ3​(q))4? (θ3(q))4=(∑k1=−∞∞qk12)(∑k2=−∞∞qk22)(∑k3=−∞∞qk32)(∑k4=−∞∞qk42)(\theta_3(q))^4 = \left( \sum_{k_1=-\infty}^{\infty} q^{k_1^2} \right) \left( \sum_{k_2=-\infty}^{\infty} q^{k_2^2} \right) \left( \sum_{k_3=-\infty}^{\infty} q^{k_3^2} \right) \left( \sum_{k_4=-\infty}^{\infty} q^{k_4^2} \right)(θ3​(q))4=(∑k1​=−∞∞​qk12​)(∑k2​=−∞∞​qk22​)(∑k3​=−∞∞​qk32​)(∑k4​=−∞∞​qk42​) When we expand this product, we get a sum of terms like qk12qk22qk32qk42=qk12+k22+k32+k42q^{k_1^2} q^{k_2^2} q^{k_3^2} q^{k_4^2} = q^{k_1^2+k_2^2+k_3^2+k_4^2}qk12​qk22​qk32​qk42​=qk12​+k22​+k32​+k42​. The total coefficient of a term qnq^nqn will be the sum of 1s for every time a term qnq^nqn is formed—in other words, it is precisely r4(n)r_4(n)r4​(n), the number of ways to write nnn as a sum of four squares! (θ3(q))4=∑n=0∞r4(n)qn(\theta_3(q))^4 = \sum_{n=0}^{\infty} r_4(n) q^n(θ3​(q))4=∑n=0∞​r4​(n)qn This is extraordinary. All the information about our counting problem is now encoded in the coefficients of a single function. Jacobi's great achievement was to prove that this theta function is identical to another type of function from complex analysis (an Eisenstein series), whose coefficients were already known to be related to the sum-of-divisors function. By equating the two, he derived his miraculous formula for r4(n)r_4(n)r4​(n). This approach transforms a discrete problem about integers into a continuous problem in the world of complex functions, revealing deep and unexpected identities along the way.

The Geometric Key: Lattices in Four Dimensions

Our third perspective is perhaps the most visually intuitive, though it takes place in four dimensions! Think of the set of all points with integer coordinates, (x,y,z,w)(x,y,z,w)(x,y,z,w), as a giant crystal-like grid, or ​​lattice​​, in 4D space, which we can call Z4\mathbb{Z}^4Z4. Lagrange's theorem is the statement that for any non-negative integer nnn, there is a point on this grid whose squared distance from the origin is exactly nnn.

How could one possibly prove this? The "geometry of numbers," pioneered by Hermann Minkowski, offers a stunning method. The proof goes something like this:

  1. For the integer nnn you want to represent, you don't look at the standard grid Z4\mathbb{Z}^4Z4. Instead, you define a new, "warped" lattice, Λ\LambdaΛ, which is a sublattice of Z4\mathbb{Z}^4Z4. This lattice is cleverly constructed so that for any point (a,b,c,d)(a,b,c,d)(a,b,c,d) on it, the sum of its squares a2+b2+c2+d2a^2+b^2+c^2+d^2a2+b2+c2+d2 is guaranteed to be a multiple of nnn.

  2. Next, you invoke Minkowski's beautiful Convex Body Theorem. This theorem is a fundamental principle of geometry, and it states that any convex, symmetric shape (like a sphere or a cube) that is "big enough" is guaranteed to contain at least one point (other than the origin) from any given lattice.

  3. We apply this theorem to our lattice Λ\LambdaΛ. We draw a 4-dimensional ball (a hypersphere) centered at the origin. We can calculate the exact radius this ball needs to have to be "big enough" to guarantee it traps a non-zero point from our lattice Λ\LambdaΛ. This critical radius turns out to be Rmin⁡=(32det⁡(Λ)π2)1/4R_{\min} = \left(\frac{32 \det(\Lambda)}{\pi^2}\right)^{1/4}Rmin​=(π232det(Λ)​)1/4.

  4. The final step is the masterstroke. The construction of the lattice Λ\LambdaΛ and the size of the ball are perfectly balanced. We have found a non-zero point (a,b,c,d)(a,b,c,d)(a,b,c,d) in our lattice that satisfies two conditions: a) a2+b2+c2+d2a^2+b^2+c^2+d^2a2+b2+c2+d2 is a multiple of nnn (from property 1). b) a2+b2+c2+d2a^2+b^2+c^2+d^2a2+b2+c2+d2 is strictly less than 2n2n2n (from the size of the ball).

Putting these together, the only positive multiple of nnn that is strictly less than 2n2n2n is nnn itself! We are forced to conclude that a2+b2+c2+d2=na^2+b^2+c^2+d^2 = na2+b2+c2+d2=n. We have geometically "trapped" a solution. This proof is a powerful demonstration of how continuous, geometric arguments about volume can provide concrete answers to discrete questions about integers.

So there you have it. A single truth—that every number is a sum of four squares—can be seen as a consequence of the algebra of quaternions, the analysis of theta functions, or the geometry of 4D lattices. Each perspective reveals a different facet of this mathematical jewel, and their convergence is a testament to the profound, underlying unity of mathematics. It is this unity that makes the journey of discovery so rewarding. And thanks to an algorithmic perspective based on these ideas, we can even write a simple computer program to find these representations for any number we choose, making this beautiful abstraction a computational reality.

Applications and Interdisciplinary Connections

Now that we have taken apart the beautiful machine of Lagrange's theorem, admiring its gears and principles, it is time to ask the most exciting question of all: What can it do? What is it for? You might be tempted to think that representing numbers as sums of squares is a quaint game for number theorists, a curiosity confined to the abstract realm of pure mathematics. Nothing could be further from the truth.

This simple idea, born from ancient questions about integers, turns out to be a master key, unlocking doors to astonishingly diverse fields of science. It acts as a secret bridge connecting the discrete world of whole numbers to the continuous landscape of analysis, the geometric structure of spacetime, and even the unpredictable domain of chance. Let us walk across these bridges and marvel at the vistas they reveal.

A Glimpse of Order in Chaos: Analysis and Asymptotics

If you were to compute the function r4(n)r_4(n)r4​(n)—the number of ways to write nnn as a sum of four squares—for various integers, you would find a sequence that jumps around almost erratically. For n=1n=1n=1, r4(1)=8r_4(1)=8r4​(1)=8. For n=2n=2n=2, r4(2)=24r_4(2)=24r4​(2)=24. For n=7n=7n=7, r4(7)=64r_4(7)=64r4​(7)=64, but for n=8n=8n=8, r4(8)=24r_4(8)=24r4​(8)=24. It looks like a mess! But in mathematics, as in physics, we often find that looking at things from a distance reveals a hidden order.

What if we ask not about r4(n)r_4(n)r4​(n) for a specific nnn, but about its average behavior as nnn gets larger and larger? It is like asking not for the precise position of a single gas molecule in a box, but for the overall pressure it and its companions exert. The answer is astonishingly simple and elegant: on average, r4(n)r_4(n)r4​(n) grows in direct proportion to nnn.

Advanced tools from complex analysis reveal this profound truth. By encoding the entire sequence of r4(n)r_4(n)r4​(n) values into a single object called a generating function, specifically the fourth power of a Jacobi theta function, (ϑ3(τ))4(\vartheta_3(\tau))^4(ϑ3​(τ))4, the problem is transformed. The large-nnn behavior of the coefficients r4(n)r_4(n)r4​(n) becomes linked to the behavior of this function near its "hot spots," or singularities. Using powerful techniques like the method of steepest descent or the Hardy-Littlewood circle method, one can peer into the soul of the generating function and extract the dominant trend. The result of this deep analysis is that for large nnn, the leading behavior is beautifully simple: r4(n)∼π2nr_4(n) \sim \pi^2 nr4​(n)∼π2n. It is a spectacular result; the number of ways to construct an integer using four squares is, on average, a simple constant multiple of the integer itself, and that constant involves the fundamental geometric number π2\pi^2π2!

We can see this same linear growth from a different angle. Instead of looking at individual values, we can sum them all up and see how the total grows. The cumulative sum, ∑n=1Nr4(n)\sum_{n=1}^N r_4(n)∑n=1N​r4​(n), represents the total number of four-square representations for all integers up to NNN. Analysis shows that this sum grows like π22N2\frac{\pi^2}{2}N^22π2​N2. The average value of r4(n)r_4(n)r4​(n) up to NNN is this sum divided by NNN, which again points to a growth proportional to NNN. It is like confirming the speed of a rocket by both checking its instantaneous speedometer and by measuring the total distance it covered in a given time—both methods yield the same conclusion.

The Grand Symphony of Numbers: Connections to the Zeta Function

The story deepens when we change our perspective and use a different kind of lens to view the r4(n)r_4(n)r4​(n) sequence. Instead of a power series, let us build a "Dirichlet series," a structure of central importance in number theory, defined as L(s)=∑n=1∞r4(n)nsL(s) = \sum_{n=1}^\infty \frac{r_4(n)}{n^s}L(s)=∑n=1∞​nsr4​(n)​. At first, this seems like just another formalism. But an almost magical identity, a Rosetta Stone for this problem, reveals that this function is no stranger. It can be expressed entirely in terms of the undisputed monarch of analytic number theory, the Riemann zeta function ζ(s)\zeta(s)ζ(s):

L(s)=8(1−41−s)ζ(s)ζ(s−1)L(s) = 8(1 - 4^{1-s})\zeta(s)\zeta(s-1)L(s)=8(1−41−s)ζ(s)ζ(s−1)

This is a breathtaking revelation. It tells us that the function encoding the four-square problem is intimately related to the function that encodes the properties of the prime numbers. It is like discovering that the laws governing the vibration of a drumhead are secretly the same as the laws governing the orbits of planets. This unity is a hallmark of deep mathematics. This formula allows us to probe the properties of r4(n)r_4(n)r4​(n) by studying the well-known properties of ζ(s)\zeta(s)ζ(s). For instance, by analyzing the behavior of both sides of this equation near their poles (points where they "blow up"), mathematicians can uncover hidden relationships and compute constants that would otherwise be inaccessible.

And just as we can use generating functions to understand r4(n)r_4(n)r4​(n), we can turn the tables and use our knowledge of r4(n)r_4(n)r4​(n) to solve problems that seem completely unrelated. Consider, for example, the fearsome-looking definite integral:

I=∫0∞x2((θ3(e−πx))4−1)dxI = \int_0^\infty x^2 \left( \left(\theta_3(e^{-\pi x})\right)^4 - 1 \right) dxI=∫0∞​x2((θ3​(e−πx))4−1)dx

By recognizing that the term in the parenthesis is simply the generating function for r4(n)r_4(n)r4​(n) for n≥1n \ge 1n≥1, we can swap the integral and an infinite sum. This transforms the problem from one of integration into one of summing a series involving r4(n)r_4(n)r4​(n). Using the properties of r4(n)r_4(n)r4​(n) and its connection to the zeta function, this series can be calculated exactly, allowing us to conquer the integral and find its precise value, 5ζ(3)2π\frac{5\zeta(3)}{2\pi}2π5ζ(3)​. This is a beautiful example of number theory lending its power to the world of analysis.

The Geometry of Space and Energy: Physics and Lattice Sums

Let us now take a giant leap from the abstract world of functions into the physical world of space and geometry. Imagine a vast, perfectly ordered crystal, or more simply, a grid of points in space like a cosmic jungle gym. In physics, especially in quantum field theory and condensed matter physics, one often needs to compute sums over all the points of such a lattice. For example, the electrostatic energy of an ionic crystal or the quantum vacuum energy (the famous Casimir effect) involves summing quantities over an infinite grid.

A fundamental object in this study is the Epstein zeta function, which for a simple ddd-dimensional cubic lattice is the sum of 1/(distance2)s1/(\text{distance}^2)^s1/(distance2)s over all non-zero lattice points. For a four-dimensional hypercubic lattice, this is:

ζZ4(s)=∑(n1,n2,n3,n4)∈Z4∖{0}1(n12+n22+n32+n42)s\zeta_{\mathbb{Z}^4}(s) = \sum_{(n_1,n_2,n_3,n_4) \in \mathbb{Z}^4 \setminus \{\mathbf{0}\}} \frac{1}{(n_1^2 + n_2^2 + n_3^2 + n_4^2)^s}ζZ4​(s)=∑(n1​,n2​,n3​,n4​)∈Z4∖{0}​(n12​+n22​+n32​+n42​)s1​

Now, look closely at the denominator. It is the sum of four squares! If we group all the points that are the same distance from the origin—that is, all points lying on a "sphere" of a given squared radius k=n12+n22+n32+n42k = n_1^2 + n_2^2 + n_3^2 + n_4^2k=n12​+n22​+n32​+n42​—how many such points are there? This is precisely the question that r4(k)r_4(k)r4​(k) answers! The physical lattice sum can therefore be rewritten as:

ζZ4(s)=∑k=1∞r4(k)ks\zeta_{\mathbb{Z}^4}(s) = \sum_{k=1}^{\infty} \frac{r_4(k)}{k^s}ζZ4​(s)=∑k=1∞​ksr4​(k)​

This is exactly the Dirichlet series we encountered before!. The abstract number-theoretic counting problem is secretly identical to the geometric problem of counting points on concentric spheres in a 4D grid. This profound link means that our formula connecting L(s)L(s)L(s) to the Riemann zeta function becomes a powerful tool for physicists and mathematicians to calculate these important lattice sums. For instance, this connection allows one to find the otherwise mysterious values ζZ4(1)=−8ln⁡2\zeta_{\mathbb{Z}^4}(1) = -8\ln 2ζZ4​(1)=−8ln2 and ζZ4(4)=7π4ζ(3)80\zeta_{\mathbb{Z}^4}(4) = \frac{7\pi^4\zeta(3)}{80}ζZ4​(4)=807π4ζ(3)​.

The Number Theorist at the Casino: Probability and Chance

Could there be a connection to the world of randomness and probability? Let's find out. Imagine a strange, cosmic die that can land on any positive integer. The die is biased, however; the probability of it landing on a number nnn follows a Zipf distribution, P(X=n)=n−s/ζ(s)P(X=n) = n^{-s} / \zeta(s)P(X=n)=n−s/ζ(s), where s>1s > 1s>1 is some fixed parameter. Such "power-law" distributions are not just a fantasy; they appear everywhere in nature and society, from the frequency of words in a language to the populations of cities.

Now, let us ask a couple of peculiar questions. First, if we roll this die once, what is the expected number of ways the resulting integer can be written as a sum of four squares? This sounds like a monstrous calculation. But it unfolds with stunning simplicity. The expectation is the sum of r4(n)r_4(n)r4​(n) weighted by its probability P(X=n)P(X=n)P(X=n), which leads us directly back to our friend, the Dirichlet series for r4(n)r_4(n)r4​(n). The answer is a clean and simple expression: 8(1−41−s)ζ(s−1)8(1-4^{1-s})\zeta(s-1)8(1−41−s)ζ(s−1).

Let's ask another question. We know from Legendre's three-square theorem that certain numbers, those of the form 4k(8m+7)4^k(8m+7)4k(8m+7), are "stubborn" and require all four squares for their representation. What is the probability that our random integer KKK is one of these stubborn numbers? To find this, we must sum the probabilities for all such numbers. This task, which seems hopelessly complex, can be tamed using the tools of number theory. The sum separates beautifully into a geometric series and another special function, the Hurwitz zeta function, yielding a precise, analytic answer. What began as a question about chance ends up being answered by the deep and deterministic structure of number theory.

From integers to integrals, from generating functions to the geometry of lattices, from the heart of number theory to the unpredictable world of probability, the sum of four squares builds bridges. It teaches us a profound lesson about the nature of science: the most beautiful discoveries are often those that reveal the hidden unity of it all, showing us that the separate fields of our knowledge are but different windows looking out upon the same, magnificent universe.