Fix any $k\in\mathbb{N}_{\ge 0}$. Note that if $k=0$ then we are done by considering $a_{t^2}$, suppose $k\ge 1$. We consider $n=p(p+k)$ where $p\gg k$ is a large prime. Note that $p<\sqrt{n}=\sqrt{p(p+k)}<p+k$. We now prove $n$ has no other divisors $d$ such that $p<d<p+k$, so $a_{p(p+k)} = k$ as desired.
Let $d\mid p(p+k)$. If $p\mid d$ then $d=pi$ for $i\ge 2$, this however implies $2p\le pi<p+k$, contradicting with $p\gg k$. So, $(p,d)=1$. Likewise, if $d\mid p+k$ then $d\le (p+k)/2$ trivially, so $p<k<(p+k)/2$, once again contradicting with $p\gg k$. So, $p$ is indeed the largest divisor of $n=p(p+k)$ less than $\sqrt{n}$, completing the proof.