<s>[INST] Special Factorization Consider the natural numbers that are sum of a perfect square plus the product of consectutive natural numbers. For example, $97 = 5^{2} + 8\cdot 9$. What is the smallest multiple of 2019 that is not as described above?
Someone can help me? Thank you in advance.
 [/INST] consider the following theorem:

theorem: An integer greater than one can be written as a sum of two squares if and only if its prime decomposition contains no prime congruent to $3(mod4)$ raised to an odd power.

Now, observe that
$$N = m^{2} + n\cdot (n + 1) \Leftrightarrow$$
$$4N = 4m^{2} + 4n^{2} + 4n \Leftrightarrow$$
$$4N + 1 = 4m^{2} + 4n^{2} + 4n + 1 \Leftrightarrow$$
$$4N + 1 = (2m)^{2} + (2n + 1)^{2}$$ 
Then, observe that
$4 \cdot 2019 + 1 = 8077$, and the prime decomposition of $8077$ is 
$$8077 = 41 \cdot 197$$
where $41 \equiv 1 (mod4)$ and $197 \equiv 1 (mod 4)$. Therefore, $8077$ can be written as a sum of two squares.
Consider
$4 \cdot (2 \cdot 2019) + 1 = 16153$, and the prime decomposition of $16153$ is
$$16153 = 29 \cdot 557$$
where $29 \equiv 1 (mod4)$  and $557 \equiv 1 (mod4)$. Therefore, $16153$ can be written as a sum of two squares.
Now consider
$4 \cdot (3 \cdot 2019) + 1 = 24229 (prime)$, and $24229 \equiv 1 (mod4)$
Lastly, 
$4 \cdot (4 \cdot 2019) + 1 = 32305$ and the prime decomposition of $32305$ is
$$32305 = 5 \cdot 7 \cdot 13 \cdot 71$$ 
Thus, we have $7 \equiv 3(mod 4)$ and $7$ is raised to an odd power. Hence $32305$ is not a sum of two squares, thus $4 \cdot 2019$ is the smallest multiple of 2019 that is not $m^{2} + n \cdot (n + 1)$
</s>