\section*{Problem 5 - 141035}

Determine all natural numbers \(n\) with \(n<40\) for which the number \(n^{2}+6 n-187\) is divisible by 19 without a remainder!
}

Due to \(-187 \equiv 3\) mod 19, this is essentially about solving the quadratic congruence

\[
n^{2}+6 n+3 \equiv 0
\]
or after a simple transformation,

\[
(n+3)^{2} \equiv 6 \quad \bmod 19
\]

it then essentially comes down to the question of whether 6 is a quadratic residue modulo 19 or not, and if so, how to determine the two square roots of \(6 \bmod 19\).

From the theory of quadratic residues, we know that the solutions to a congruence \(x^{2} \equiv a\) mod \(p\) for a prime \(p \equiv 3 \bmod 4\) must have the form \(x \equiv \pm a^{(p+1) / 4} \bmod p\), provided that \(a\) is a quadratic residue \(\bmod p\).

In our case here, \(6^{5} \equiv 5 \bmod 19\), and indeed, \(x \equiv \pm 5 \bmod 19\) are solutions to \(x^{2} \equiv 6\) mod 19, which immediately leads to the two solutions \(n \equiv 2 \bmod 19\) and \(n \equiv 11 \bmod 19\) of the congruence (*). In relation to the original question, this means that the numbers \(n \in\{2,11,21,30\}\) solve the problem.