4. Place $n$ special points on a plane, no three of which are collinear, and their colors are either red, green, or yellow, satisfying the following conditions:
(1) In a triangle with all vertices red, there is at least one green point;
(2) In a triangle with all vertices green, there is at least one yellow point;
(3) In a triangle with all vertices yellow, there is at least one red point.
Find the maximum possible value of the integer $n$.
4. Solution: Assume there are $a$ red points, and their convex hull is a convex $k$-gon. Inside this convex hull, there are $b$ green points, and their convex hull is a convex $l$-gon. Inside this, there are $c$ yellow points, and their convex hull is a convex $m$-gon. Inside this, there are $a'$ red points.

If all the vertices of a triangle are of the same color, then the triangle is called a red, green, or yellow triangle.

Since the convex hull of all red points can be exactly divided into $2a - k - 2$ non-overlapping red triangles, and each such triangle contains at least one green point, we have:
\[ b \geq 2a - k - 2. \]
Similarly, we have:
\[ c \geq 2b - l - 2 \geq b - 2; \]
\[ a' \geq 2c - m - 2 \geq c - 2. \]
Since the $k$ red points on the red convex hull cannot be counted in $a'$,
\[ a \geq a' + k. \]
Thus, we have:
\[ a \geq a' + k \geq (c - 2) + k \geq [(b - 2) - 2] + k \geq \{[(2a - k - 2) - 2] - 2\} + k = 2a - 6. \]
Therefore, \( a \leq 6 \), meaning the number of red points cannot exceed 6.
By symmetry, the number of green points or yellow points cannot exceed 6 either.
Thus, \( n \) cannot be greater than 18.

Next, we prove that 18 is the maximum value.
We provide a specific placement of 18 points.
First, consider 6 red points. According to the previous discussion, there should be 4 green points inside the convex hull of these red points, placed as shown in the figure. Points \( A, F, I, C, H, J \) are red, and points \( B, G, D, E \) are green. All points are symmetrically placed relative to \( O \). The rectangles \( ABCD \) and \( EFGH \) have side lengths in the ratio \( 1: \sqrt{3} \). Note that each red triangle contains exactly one green point.

Place the other two green points at the positions where points \( I \) and \( J \) are rotated 60 degrees counterclockwise around point \( O \). Similarly, place the yellow points at the positions where the green points are rotated 60 degrees counterclockwise around point \( O \). By symmetry, this provides the required placement.