Question 175
Let $f(n) = \left| \binom{n}{0} + \binom{n}{3} + \binom{n}{6} + \dots + \binom{n}{3\left\lfloor \frac{n}{3} \right\rfloor} - \frac{2^n}{3} \right|$, where $\lfloor x \rfloor$ is the greatest integer not exceeding $x$. Find $f(1) + f(2) + \dots + f(2021)$.