Sums of Squares
A. Student
October 2026
Abstract
A short article: sections, numbered equations, theorems with proofs, and cross-references.

1Introduction

Which integers are sums of two squares? We collect the classical answer; see Theorem 2.3 and Section 3.

2Statement

Definition 2.1. An integer n≥0n \ge 0 is a sum of two squares if n=a2+b2n = a^2 + b^2 for some a,b∈Za, b \in \mathbb {Z}.
Lemma 2.2. Products of sums of two squares are sums of two squares:
(a2+b2)(c2+d2)=(ac−bd)2+(ad+bc)2.(1) (a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 . \tag{1}
Theorem 2.3 (Fermat). An odd prime pp is a sum of two squares if and only if p≡1(mod4)p \equiv 1 \pmod 4.

3Proof sketch

Proof. If p=a2+b2p = a^2 + b^2, then p≡1(mod4)p \equiv 1 \pmod 4, since squares are 00 or 11 modulo 44. Conversely, choose xx with x2≡−1(modp)x^2 \equiv -1 \pmod p and apply Thue’s lemma; by (1) the rest follows. ∎
∑n=1∞1n2=π26,∫01xn dx=1n+1.\begin{align*} \sum _{n=1}^{\infty } \frac {1}{n^2} &= \frac {\pi ^2}{6}, & \int _0^1 x^n \, dx &= \frac {1}{n+1}. \tag{2}\end{align*}