$k$ squares problem
Let’s fix a natural number \(k\). How many ways can we decompose \(n\) into \(k\) squares? It’s an interesting problem and it should help me understand automorphic forms better.
Let \(w_k(n)\) be the number of tuples \((n_1, \cdots, n_k)\in \mathbb{Z}^k\) such that \(n_1^2+\cdots+n_k^2=n\). Let \(g_k(q)\) be the generating function of \(w_k(n)\), i.e., \[g_k(q)=\sum_{n \in \mathbb{N}} w_k(n)q^n.\] Then, \[\begin{split} g_k(q) &= \sum_{n \in \mathbb{N}} w_k(n)q^n \\ &= \sum_{n \in \mathbb{N}} \sum_{\substack{n_1, \cdots, n_k \in \mathbb{Z} \\ n_1^2+\cdots+n_k^2=n}}q^n \\ &= \sum_{n_1, \cdots, n_k \in \mathbb{Z}} q^{n_1^2+\cdots+n_k^2} \\ &= \left(\sum_{n \in \mathbb{Z}} q^{n^2}\right)^k \\ &= (g_1(q))^k. \end{split}\]