There are 4,072,324 rooms arranged in an equilateral triangle, similar to the image at right (but extending much further down).

Each room has a door to all adjacent rooms with which it shares a wall. You are currently standing in the room at the top, and your mission is to enter every single room on one condition: you can't enter a room more than twice.

Employing the best strategy to accomplish your goal, what is the least number of rooms you need to enter twice?

The answer is 2017.

**
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 following picture represents the path to visit all the rooms.

There is a double-visited room per 'floor', except for the top room. The number of 'floor' is

$\displaystyle\sum_{k=0}^{n} 2k+1=4072324$ , $\displaystyle n=2017$

So, the number of double-visited rooms plus $1$ is

$\displaystyle (2017-1)+1=2017$