Putnam 2023, Problem A-1

For a positive integer \( n \), let \( f_n(x) = \cos(x)\cos(2x)\cos(3x)\cdots\cos(nx) \). Find the smallest \( n \) such that \( |f_n''(0)| > 2023 \).

Solution:
If we use the product rule to calculate $f_n''(x)$, the result is a sum of terms of two types: terms where two distinct factors $\cos(m_1x)$ and $\cos(m_2x)$ have each been differentiated once, and terms where a single factor $\cos(mx)$ has been differentiated twice. When we evaluate at $x=0$, all terms of the first type vanish since $\sin(0)=0$, while the term of the second type involving $(\cos(mx))''$ becomes $-m^2$. Thus
$$|f_n''(0)| = \left| -\sum_{m=1}^n m^2 \right| = \frac{n(n+1)(2n+1)}{6}.$$
The function $g(n) = \frac{n(n+1)(2n+1)}{6}$ is increasing for $n \in \mathbb{N}$ and satisfies $g(17) = 1785$ and $g(18) = 2109$. It follows that the answer is $n = 18$.