If I understand well you need to find
$\binom{2n}{n} \mod m \,,$
where $m=500000002$.
Note that $\binom{2n}{n}$ are integers, so there is no problem with their definition. Anyhow, your approach is WRONG, as in your recursive definition you need sometime to divide by $0 \mod m$.
I would recommend you the following approach:
For each prime $p$ find first if $p | \binom{2n}{n}$ by using the formula for power of prime in a factorial. Then, if the answer is negative, cancel first $p^k$ in $\frac{(2n)!}{n! n!}$ and then try using Wilson theorem to calculate what is leftm namely $\frac{(2n)!}{p^a}$ and $\frac{(n)!}{p^b}$ modulo $p$. The prime $148721$ is a tough one though.
Alternately, if you try using your recurrence, note that the recurrence formula only works when $p \nmid n$. If $p |n$ you are dividing by 0, which probably explains the wrong answer, you need to calculate $a_n$ by a different method in this case.
P.S. Do you need to calculate it for ALL n or just some of them?