I live in an apartment building which has a prime number of floors that can't be greater than 25 because of height restrictions. Everyday, as part of my effort to lose weight, I walk up the stairs from the ground floor to the roof. Each floor burns more and more calories following the sequence of odd numbers $\big($ i.e. $1^\text{st}$ floor burns 1 calorie, $2^\text{nd}$ floor burns 3 calories, and so on $\big).$ The combined calorie burning in the top 2 floors is greater than the total calorie burning in the first 9 floors.

How many floors does the building have?

The answer is 23.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

The sum of odd numbers (starting from 1) up to the $n^\text{th}$ term is $\frac{\big(1+(2n-1)\big)\times n}{2} = \frac{2n^2}{2}=n^2.$ Now, let $k$ be the number of floors that the building has. Then we have $\begin{aligned} 9^2 < &k^2-(k-2)^2\\ 81 < &4k-4\\ 85 < &4k\\ 21.25 < &k \le 25 && (\text{because of height restrictions})\\ \Rightarrow &k=22, {\color{#D61F06}{23}}, 24, 25. && (\text{because it's prime})\\ \end{aligned}$ Therefore, the building has 23 floors. $_\square$