$a_n$ is relatively prime to $a_k$ for $k<n$
Suppose $n>4$ and $a_n$ is composite. Let $p$ be the smallest prime dividing $a_n$, so $$ p^2\leq a_n=n(n+1)-19\leq 4n^2. $$ Hence $p\leq 2n$. Let $$ k=\begin{cases} n-p&\text{if }n\geq p,\\ p-1-n&\text{otherwise}. \end{cases} $$ Then $k<n$ and $k(k+1)\equiv n(n+1)\equiv19$ mod $p$. Thus $p|a_k$, so $\gcd(a_k,a_n)\geq p>1$.