Each side of an equilateral triangle is divided into n equal parts. Lines are drawn through the division points, parallel to the sides. As a result, the triangle is divided into small triangles. We will call a chain a sequence of small triangles in which no triangle appears more than once and each subsequent triangle shares a side with the previous one. What is the maximum possible number of triangles in a chain?
Problem 866
Official solution
To prove what often happens in olympiads, it is enough to make one unexpected move: color the triangles in a checkerboard pattern, as shown in the figure. The rest is quite simple. In the entire triangle, there are
!
n more red triangles than yellow ones (in each horizontal row, there is one more red triangle), and in the chain, the colors must alternate, so there can only be one more red than yellow. One of the longest possible chains is shown in the figure. (From the above, it is clear that for a chain to have a length of , it is necessary and sufficient that it starts and ends in red triangles and passes through all yellow triangles without exception.)
## Answer
.