<s>[INST] 2018 MathCounts: Let $D(k)$ be the number of diagonals for a polygon with $k$ sides. If $D(m) + D(n) = 125$, what is the value of $m+n$? The question was asked in the 2018 Raytheon MATHCOUNTS National Competition. It appears in the video around the 35:34 mark:
https://www.youtube.com/watch?v=dSnOLW_W6og&t=2134

Let $D(k)$ be the number of diagonals for a polygon with $k$ sides. If
  $D(m) + D(n) = 125$, what is the value of $m+n$?

The formula for the number of diagonals is well-known and easily derived as $k(k-3)/2$.
I then computed several values, and found a suitable pair of numbers to solve the problem.
But is there any easier way to solve this equation:
$$\frac{n(n-3)}{2} + \frac{m(m-3)}{2} = 125$$
$$n,m \in {3, 4, ...}$$
The students were supposed to solve this in minutes without a calculator.
My guess is there is not a simpler way--in MathCounts the students may have just memorized many values.
 [/INST] We want to solve $n^2-3n+m^2-3m = 250$ for $n,m\ge 3$.
Multiplying by $8$ and symmetrizing the polynomials, we get that the equation is equivalent to solving 
$$j^2-9 + k^2-9 = 1000,$$
with $j=2n-3$, $k=2m-3$, or 
$$j^2+k^2=1018.$$
Mod $3$ we have $$j^2+k^2\equiv 1\pmod{3},$$ so one of $j$ or $k$ is divisible by $3$. Without loss of generality then, $j=3x$. 
Now we want to solve 
$$9x^2 + k^2 =1018.$$
Mod $9$, we get 
$$k^2 \equiv 1\pmod{9}.$$ Then $k=9y+10$ or $9y+8$ for some $y>0$, since the units mod $9$ are cyclic.
Now we have either
$$9x^2 + 81y^2+180y+100 = 1018$$
which reduces to 
$$ x^2 + 9y^2 + 20y = 102$$
or 
$$9x^2+81y^2+144y + 64 = 1018,$$
which reduces to 
$$ x^2 + 9y^2 + 16y = 106$$
In either case, $1\le y\le 2$.
Thus we are reduced to computing four values less than $100$ and checking whether they are squares:
For $y=1$, computing
$102- (9y^2+20y)$ and $106-(9y^2+16y)$  gives 
 $102-29 = 73$, and $106-25 = 81$.
$81=9^2$, so we are already done without checking $y=2$. This gives $x=9$, $y=1$, corresponding to $j=27$, $k=17$, and thus $n=15$, $m=10$.
Checking our work yields 
$$15\cdot 6 + 5\cdot 7 = 90+35=125.$$
</s>