Putnam 2014, Problem A-1

Prove that every nonzero coefficient of the Taylor series of
$$(1 - x + x^2)e^x$$
about $x = 0$ is a rational number whose numerator (in lowest terms) is either $1$ or a prime number.

Solution:
The coefficient of \(x^n\) in the Taylor series of \((1 - x + x^2)e^x\) for \(n = 0, 1, 2\) is \(1, 0, \frac{1}{2}\), respectively. For \(n \geq 3\), the coefficient of \(x^n\) is  
\[
\frac{1}{n!} - \frac{1}{(n-1)!} + \frac{1}{(n-2)!} = \frac{1 - n + n(n-1)}{n!} = \frac{n-1}{n(n-2)!}.
\]  
If \(n-1\) is prime, the lowest-terms numerator is either \(1\) or the prime \(n-1\) (since \(n-1\) is relatively prime to \(n\) and \((n-2)!\)). If \(n-1\) is composite, it can be written as \(ab\) for \(a \neq b\), so both \(a\) and \(b\) appear in \((n-2)!\), making the numerator \(1\), or \(n-1 = p^2\) for some prime \(p\), in which case \(p\) appears in \((n-2)!\), so the numerator is \(1\) (unless \(p = 2\), where both \(p\) and \(2p\) appear in \((n-2)!\)).