Question 7Let $f(x) = \left(x^2 + 3x + 2\right)^{\cos(\pi x)}.$ Find the sum of all positive integers $n$ for which $$ \left|\sum_{k=1}^{n} \log_{10} f(k)\right| = 1. $$