## Solution.

Let's prove that the answer is $n(n+1)$.

Let a segment denote a length of 1.

With each side of the original triangle, there are

$$
1+2+\cdots+n=\frac{n(n+1)}{2}
$$

segments.

If we color all $n(n+1)$ segments that are parallel to one of the two sides of the original triangle, then there does not exist an equilateral triangle with all three red sides.

We still need to prove that we cannot color more than $n(n+1)$ segments without forming an equilateral triangle with three red sides.

![](https://cdn.mathpix.com/cropped/2024_05_30_4cdaff2107ef283b1d94g-25.jpg?height=620&width=722&top_left_y=1255&top_left_x=593)

Let's shade the triangles whose vertex opposite to the side parallel to the bottom side of the original triangle is pointing upwards, as shown in the figure. The bases of these triangles are segments parallel to the bottom side of the triangle, so there are $\frac{1}{2} n(n+1)$ such triangles.

No two of these triangles share a side. If more than $n(n+1)$ segments were colored red, then by the Pigeonhole Principle, at least one of the shaded triangles would have all three sides colored red. Therefore, $n(n+1)$ is the maximum number of segments that can be colored red.
## Task A-4.7.

By drawing lines parallel to each side, an equilateral triangle with side length $n$ is divided into $n^{2}$ equilateral triangles with side length 1. How many line segments of length 1 on the resulting grid can we color red so that no three red segments form an equilateral triangle?