Let $a_n$ be a sequence such that $a_1 = 1$ and $a_{n+1} = \lfloor a_n +\sqrt{a_n} +\frac12 \rfloor $, where $\lfloor x \rfloor$  denotes the greatest integer less than or equal to $x$. What are the last four digits of $a_{2012}$?

Let's think step by step and output the final answer within \boxed{}.
user