Show that for each natural number $n≥2,$ there exists an integer $a>0$ such that $(6a+1)a$ leaves a remainder of $1$ upon division by $n.$
This question was on the Irish Team Selection Test for this year.
The question comes down to solving the congruence $6a^2 + a - 1\equiv_n0.$ We may factor this and write it as $(3a-1)(2a+1)\equiv_n0.$ So, if $n$ is odd, it suffices to take $a=\frac{n-1}{2}.$ If $n$ is $1$ mod $3,$ then $2n$ is $2$ mod $3,$ and hence we may take $a=\frac{2n+1}{3}.$ If $n$ is $2$ mod $3,$ take $a=\frac{n+1}{3}.$
The only case we are left with is when $n$ is a multiple of $6.$ I do not know how to proceed in this case. One thing I noticed is that in this case, taking $a=n-5$ works many times for small values of $n.$ This happens only for those $n$ that divide $144$ (and are multiples of $6,$ of course). It will be clear why this happens once $6a^2+a-1$ is expanded with $a=n-5.$ Beyond this, I have no idea.
How to deal with this case?