"Imagine that you are on a street with houses marked 1 through n. There is a house in between (x) such that the sum of the house numbers to the left of it equals the sum of the house numbers to its right. If n is between 50 and 500, what are n and x?"
Ramanujan gave the solution in continued fractions. According to the link below, "The unusual part was that it was the solution to the whole class of problems".
I was trying to solve it and got stuck at finding integral solutions of
n*(n+1)/2 = x^2
I solved it by trial and error using the fact that n and (n+1) are coprime, making it necessary that whichever be the odd number among n or n+1, it should be a perfect square and the other one should be twice of a perfect square. So, n came out to be 288, for the given range.
But, the problem remains: how can it be solved using continued fraction? https://en.wikipedia.org/wiki/Srinivasa_Ramanujan#Mathematical_achievements
Other than this answer:
If the house number is $r$, then we have $$ 1+2+\cdots (r-1) = (r+1)+\cdots+ n$$ The LHS is $\frac{r(r-1)}{2}$ and if we add $\frac{r(r+1)}{2}$ to it, we have $$r^2 = \frac{n(n+1)}{2}$$ Multiplying by $8$ and adding $1$, we get, $$8r^2+1 = (2n+1)^2$$
This is the Brahmagupta equation (popularly called Pell’s equation) for which the ancient Indian mathematician Brahmagupta had given a complete solutions! His solution - the ‘CHAKRAVALA’ method - can be expressed using continued fractions as follows.
For a positive integer $N$ which is not a perfect square, the $$\sqrt{N} = [b_0;\overline{b_1,b_2,··· ,b_r,2b_0}]$$ Further, the penultimate convergent $[b_0; b_1, b_2, · · · , b_r]$; in fact, each of the convergents $$ [b_0;b_1,b_2,··· ,b_r,2b_0,b_1,b_2,··· ,b_r]$$ etc. gives a solution of $x^2 −Ny^2 =−1$ or of $x^2 −Ny^2 =1$ according as to whether the period $r + 1$ above is odd or even.
As $$\sqrt{8} = [2;\overline{1,4}]$$, the convergents $\frac{3}{1}, \frac{17}{6}, \frac{99}{35}, \frac{577}{204}, \frac{3363}{1189}$,··· give solutions of $x^2 − 8y^2 = 1$. Hope it helps.