Let $f(n)=\left|\binom{n}{0}+\binom{n}{3}+\dots +\binom{n}{3[\frac{n}{3}]}-\frac{2^n}{3}\right|,$ where $[x]$ is the greatest integer not exceeding $x.$ Find $$f(1)+f(2)+\dots+f(2021).$$
Source: Hong Kong TST - HKTST 2022 1.5
Tags: algebra, binomial coefficients
Let $f(n)=\left|\binom{n}{0}+\binom{n}{3}+\dots +\binom{n}{3[\frac{n}{3}]}-\frac{2^n}{3}\right|,$ where $[x]$ is the greatest integer not exceeding $x.$ Find $$f(1)+f(2)+\dots+f(2021).$$