For a positive integer $n$ with $0 \leq n<2^{12}-1$, let $f(n)$ be equal to $n$ if there is a perfect square $m$ which leaves a remainder of $n$ when divided by $2^{12}$, and let $f(n)$ be $0$ otherwise. Determine the remainder when $$\sum_{n = 0}^{2^{12}-1}f(n)$$ is divided by $2^{12}$.
For $m = k^2$ we have $k^2 \equiv n \pmod{2^{12}}$. We are then trying to determine the sum of the quadratic residues modulo $2^{12}$. How can we do this?