Find n in sum that results in a number $aaa$ Lets say that we have the sum $1+2+3+\ldots+n$ where $n$ is a positive natural number and that this sum should equal a three digit number in which all the digits are the same, for example $111, 222,$ and so on.
What would be the best way to find the $n$ that would result in such a number? I guess you could solve $\frac{n(n+1)}{2}=111x$ but that seems a bit too hard.
From trial and error we know that the only solution is $n=36$ which gives $666$.

$$\begin{align}
\frac {n(n+1)}2&=111m\qquad (m=1,2,3,\cdots,9)\\
n^2+n-222m&=0\\
n&=\frac {-1\pm \sqrt{1+888m}}2\end{align}$$
Check for values of $m$ where $(1+888m)$ is a perfect square of an odd number.
The only solution is $m=6$, where $\sqrt{1+888m}=73$. This gives 
$$n=\frac {-1\pm 73}2=36\qquad (n>0)$$
