<s>[INST] Find numbers divisible by 6 Find the number of all $n$, $1 \leq n \leq 25$ such that $n^2+15n+122$ is divisible by 6.
My attempt. We know that:
\begin{align*}
n^2+15n+122 & \equiv n^2+3n+2 \pmod{6}
\end{align*}
But $n^2+3n+2=(n+1)(n+2)$, then $n^2+15n+122 \equiv (n+1)(n+2) \pmod{6}$, now we have
\begin{align*}
n(n^2+15n+122) & \equiv n(n+1)(n+2)\pmod{6} \\
n^3+15n^2+122n & \equiv 0 \pmod{6}
\end{align*}
I have done this and I think I have complicated the problem even more.
 [/INST] If $n$ must be an integer: HINT: First, $n^2+15n+122$ is even for all integers $n$. Then $n^2+15n+122$ will be divisble by $6$ iff $n^2+15n+122$ is a muliple of $3$. So what integers $n \pmod 3$ is $n^2+15n+122$ a multiple of $3$?
You can tell working $\pmod 3$, that $n^2+15n+122$ is divisible by $3$ for every integer $n$ that is not a multiple of 3. [Indeed, $$n^2+15n+122 \pmod 3 = n^2+2 $$ $$= 0 \ \text{ if $n \pmod 3 \not = 0$}.] $$ Thus, $n^2+15n+122$ is divisible by $3$ iff $n \pmod 3$ is in $\{1,2\}$.
Thus, from this and the top paragraph, $n^2+15n+122$ is divisible by $6$ iff $n \pmod 3$ is in $\{1,2\}$.
If $n$ is allowed to be any real number and not just integral: Note that, as $n^2+15n+122$ is continuous on $[0,25]$, the function $n^2+15n+122$ in $[0,25]$ takes all values in $[122,1122]$. There are precisely $166$ multiples of $6$ in $[122,1122]$. As $n^2+15n+122$ is strictly increasing on $[0,25]$, it follows that there is at most one real number $n \in [0,25]$ such that $n^2+15n+122 = y$.
So  for each of these $166$ multiples $y$ of $6$ in $[122,1122]$ there is exactly one real number $n \in [0,25]$ such that $n^2+15n+122 = y$.
</s>