1.2. Modular forms 9

and S2(9) = 4. Indeed, the number nine has 4 different representa-

tions: 9 = (±3)2 + 02 = 02 + (±3)2. Let us explore other similar

questions.

Let n 0 and k ≥ 2. Is the number n 0 a sum of k (integer)

squares? In other words, are there a1,...,ak ∈ Z such that n =

a1

2

+···+ak?

2

And if so, in how many different ways can you represent

n as a sum of k squares? Lagrange showed that every natural number

can be represented as a sum of k ≥ 4 squares, but how many different

representations are there?

Let Sk(n) be the number of representations of n as a sum of k

squares. Determining exact formulas for Sk(n) is a classical problem

in number theory. There are exact formulas known in a number of

cases (e.g. Eq. 1.2). The formulas for k = 4,6 and 8 are due to

Jacobi and Siegel. We write n =

2νg,

with ν ≥ 0 and odd g 0:

S4(n) = 8

d|n, 4 d

d,

S6(n) =

−1

g

22ν+4

− 4

d|g

−1

d

d2,

S8(n) = 16 ·

∑

d3 if n is odd,

∑d|n

d|n

d3

− 2

∑

d|g

d3

if n is even.

For example, S4(4) = 8(1 + 2) = 24 and, indeed

4 =

(±1)2

+

(±1)2

+

(±1)2

+

(±1)2

=

(±2)2

+ 0 + 0 + 0

= 0 +

(±2)2

+ 0 + 0 = 0 + 0 +

(±2)2

+ 0 = 0 + 0 + 0 +

(±2)2.

So there are 16 + 2 + 2 + 2 + 2 = 24 possible representations of the

number 4 as a sum of 4 squares. Notice that S4(2) = S4(4). In how

many ways can 4 be represented as a sum of 6 squares? We write

4 =

22

· 1, so ν = 2 and g = 1, and thus,

S6(4) =

−1

1

22·2+4

− 4

−1

1

·

12

=

(28

− 4) · 1 = 252.