The numbers in the sequence $101,104,109,116,\ldots$ are of the form $a_n=100+n^2$, where $n=1,2,3,\ldots$. For each $n$, let $d_n$ be the greatest common divisor of $a_n$ and $a_{n+1}$. Find the maximum value of $d_n$ as $n$ ranges through the positive integers.