The main goal of this expository article is to survey recent progress on the arithmetic Siegel-Weil formula and its applications. We begin with the classical sum of two squares problem and put it in the context of the Siegel-Weil formula. We then motivate the geometric and arithmetic Siegel-Weil formula using the classical example of the product of modular curves. After explaining the recent result on the arithmetic Siegel-Weil formula for Shimura varieties of arbitrary dimension, we discuss some aspects of the proof and its application to the arithmetic inner product formula and the Beilinson-Bloch conjecture. Rather than intended to be a complete survey of this vast field, this article focuses more on examples and background to provide easier access to the recent works [LZ, LZ21, LL, LL21]. Contents 1. Sum of two squares 1 2. Siegel-Weil formula 5 3. Geometric Siegel-Weil formula 11 4. Arithmetic Siegel-Weil formula 18 5. Local arithmetic Siegel-Weil formula 21 6. Arithmetic inner product formula 28 References 341. Sum of two squares 1.1. Which prime p can be written as the sum of two squares? For the first few primes we easily find that 5 = 1 2 + 2 2 , 13 = 2 2 + 3 2 , 17 = 1 2 + 4 2 , 29 = 2 2 + 5 2 are sum of two squares, while other primes like 3, 7, 11, 19, 23 are not. The answer seems to depend on the residue class of p modulo 4.Theorem 1.1.1. A prime p = 2 is the sum of two squares if and only if p ≡ 1 (mod 4).Theorem 1.1.1 is usually attributed to Fermat, and appeared in his letter to Mersenne dated Dec 25, 1640 (hence the name Fermat's Christmas Theorem), although the statement can already be found in the work of Girard in 1625. The "only if" direction is obvious, but the "if" direction is far from trivial. Fermat claimed that he had an irrefutable proof, but nobody was able to find the complete proof among his work -apparently the margin was often too narrow for Fermat. The Date: October 15, 2021. The author would like to thank Benedict Gross, Yifeng Liu, Murilo Zanarella and Wei Zhang for helpful comments.