An equilateral triangle of side $n$ has been divided into little equilateral triangles of side $1$ in the usual way. We draw a path over the segments of this triangulation, in such a way that it visits exactly once each one of the $\frac{(n+1)(n+2)}{2}$ vertices. What is the minimum number of times the path can change its direction?

The figure below shows a valid path on a triangular board of side $4$, with exactly $9$ changes of direction.

[asy]
unitsize(30);
pair h = (1, 0);
pair v = dir(60);
pair d = dir(120);
for(int i = 0; i < 4; ++i)
{
	draw(i*v -- i*v + (4 - i)*h);
    draw(i*h -- i*h + (4 - i)*v);
    draw((i + 1)*h -- (i + 1)*h + (i + 1)*d);
}

draw(h + v -- v -- (0, 0) -- 2*h -- 2*h + v -- h + 2*v -- 2*v -- 4*v -- 3*h + v -- 3*h -- 4*h, linewidth(2));
draw(3*h -- 4*h, EndArrow);
fill(circle(h + v, 0.1));

[/asy]

[i]Proposed by Oriol Solé[/i]
To solve this problem, we need to determine the minimum number of times a path can change its direction while visiting each vertex of an equilateral triangle of side \( n \) exactly once. The total number of vertices in such a triangle is given by \(\frac{(n+1)(n+2)}{2}\).

1. **Understanding the Path and Direction Changes**:
   - A change in direction occurs when the path switches from moving along one line segment to another that is not collinear with the first.
   - The goal is to minimize these changes while ensuring that every vertex is visited exactly once.

2. **Spiral Pattern**:
   - One efficient way to cover all vertices with minimal direction changes is to use a spiral pattern. This pattern starts at one vertex and spirals inward, covering all vertices.
   - For example, in a triangle of side \( n = 6 \), a spiral pattern can be drawn with exactly 6 changes in direction.

3. **Induction Proof**:
   - We need to prove that any path covering all vertices of a triangular board of size \( n \) has at least \( n \) changes of direction.
   - **Base Case**: For \( n = 1 \), the triangle has 3 vertices. Any path covering these vertices will have at least 1 change in direction.
   - **Inductive Step**: Assume the statement is true for a triangle of size \( n-1 \). We need to show it holds for size \( n \).

4. **Covering Vertices with Lines**:
   - Consider one side of the triangle of size \( n \). This side has \( n+1 \) vertices.
   - If each line covers at most one vertex of this side, we need at least \( n+1 \) lines.
   - If a line covers more than one vertex on this side, it must cover all vertices on this side. The remaining vertices form a smaller triangle of size \( n-1 \).
   - By the induction hypothesis, covering the remaining vertices requires at least \( n \) lines.
   - Therefore, the total number of lines required is at least \( n+1 \).

5. **Conclusion**:
   - Since the number of changes in direction is one less than the number of segments forming the path, the minimum number of direction changes is \( n \).

\(\blacksquare\)

The final answer is \( \boxed{ n } \).