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.
 A: You were almost there with your first line. You have $n^2+3n+2=(n+1)(n+2)\text{ mod 6}$
$(n+1)$ and $(n+2)$ are two consecutive numbers so one of them is even. That gives you that this polynomial is divisible by $2$ for all $n$.
If $n$ is either congruent to $1$ or $2$ mod $3$ then $(n+2)$ or $(n+1)$, respectively, is divisible by $3$. Therefore all non-multiples of $3$ are solutions to this problem.
A: If $n$ is even then $n^2+15n$ is even.  If $n$ is odd, then $n^2+15n$ is still even.  So $n^2+15n+122$ is even for every $n$.
So we just need to determine when the expression is divisible by $3$.
$$n^2+15n+122 \equiv n^2 +2 \pmod{3}.$$
It's easy to check that $n=1$ and $n=2$ are the only solutions.  So the answer is "all non multiples of $3$".  There are $8$ multiples of $3$ between $1$ and $25$, so the final number is $25-8 = 17.$
A: 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$.
