Need help with a number theory question I can't solve this question I got from a Math Olympiad past paper: 
Find all integers $a$ such that $\frac{a^2+4}{2a+1}$ is also an integer
I know $a$ can be $0$ and $-1$ but I can't ascertain if there are other values $a$ can take. 

André's answer is pretty much the best way to do this. A more naïve approach is as follows:
Suppose $\frac{a^2+4}{2a+1} = k\in\mathbb{Z}$. Then:
$a^2 - 2ka + (4-k) = 0$
This is a quadratic equation with solutions:
$a = \frac{2k \pm \sqrt{4k^2 - 4(4-k)}}{2}= k \pm\sqrt{k^2+k-4}$
For $a$ to be an integer we thus need $k^2 + k - 4$ to be a perfect square, i.e. $k^2 + k - 4 = m^2$. Rearrange and get another quadratic equation with solutions:
$k = \frac{-1 \pm \sqrt{1 + 4(4+m^2)}}{2}$
Again we want $k$ to be an integer so need $4m^2 + 17 = n^2$ for some integer $n$.
So we get a difference of two squares equation: $n^2 - (2m)^2 = 17$. Factorising tells us that $(n+2m)(n-2m) = 17$. Solving gives $m=\pm 4$, which tells us that $k=4,-5$ giving $a = -9,-1,0,8$.
You can check all $4$ of these possibilities work and so we are done.
