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.
 A: Okay since 2019 is  1 mod 5,  we can work mod 5 and translate it back later. Squares mod 5 are 0,1, or 4. products of consecutive numbers can be 0,1,2. so we have mod 5:
$$0+0\equiv 0\\0+1\equiv 1\\0+2\equiv 2\\1+0\equiv 1\\1+1\equiv 2\\1+2\equiv 3\\4+0\equiv 4\\4+1\equiv 0\\4+2\equiv 1$$ this means multipliers that are 0,2 mod 5 have 2 possible ways of getting a solution if one exists. a multiplier that is 1 mod 5 has 3 possible ways, every other multiplier has just a single way to have it work. You can chinese remainder theorem this with mod 7 and see if all multipliers can have a possible way mod 35. any that don't are an upper bound on where the minimum multiplier that fails is. 
A: 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)$
