4. There are 18 points on a plane, where no three points are collinear. Each pair of points is connected by a line segment, and these line segments are colored either red or blue, with each line segment being only one color. It is known that a certain point $A$ has an odd number of red line segments, and the number of red line segments from the other 17 points are all different. Find the number of triangles in this graph where all three sides are red, and the number of triangles where two sides are red and one side is blue (the vertices of the triangles must be among the known 18 points).
4. First, the number of red line segments drawn from each point can only be one of $0,1,2, \cdots, 17$, because 0 and 17 cannot appear simultaneously, thus there are only two possibilities: $1,2, \cdots, 17$ or $0,1,2, \cdots, 16$. If the base is $0,1,2, \cdots, 16$, then the total number of red line segments (assuming $A$ draws $2 k+1$ red edges) is 
$\frac{1}{2}\left(\frac{16 \times 17}{2}+2 k+1\right)$, which is not an integer. Contradiction!
Thus, the other 17 points each draw $1,2,3, \cdots, 17$ red edges. Suppose $A_{i}$ draws $i$ red edges, and $A$ draws $2 k+1$ red edges, then $A_{17}$ is connected to $A, A_{1}, A_{2}, \cdots, A_{16}$. $A_{16}$, except for being connected to $A_{1}$, is connected to the other 16 points with red edges.
Proceeding in this manner:
$A_{15}$ is connected to 15 points except $A_{1}, A_{2}$ with red edges, $A_{9}$ is connected to 9 points except $A_{1}, A_{2}, \cdots, A_{8}$ with red edges, thus $A_{17}$, $A_{16}, \cdots, A_{9}$ are connected to $A$ with red edges.
$A_{8}$ is only connected to 8 red edges, $A_{8}$ is already connected to $A_{17}, \cdots A_{10}$ with red edges.
$\therefore A_{8}$ is not connected to $A$ with a red edge,
Similarly, $A_{7}, A_{6}, \cdots A_{1}$ are not connected to $A$ with red edges.
$\because d(A)=9$.
Let the number of triangles with all three sides red be $x$, the number of triangles with two red sides and one blue side be $y$, the number of triangles with two blue sides and one red side be $z$, and the number of triangles with all three sides blue be $w$.
Then $x+y+z+w=C_{18}^{3}$,
The number of red angles is $C_{9}^{2}+\sum_{t=0}^{17} C_{i}^{2}=3 x+y$,
The number of blue angles is $C_{8}^{2}+\sum_{i=0}^{16} C_{i}^{2}=z+3 \omega$,
The number of mixed-color angles is $1 \times 16+2 \times 15+\cdots+16 \times 1+9 \times 8=2 y+2 z$,
The number of red edges is $\frac{1}{16}(3 x+2 y+z)=\frac{1}{2}(1+2+\cdots+17+9)$.
Since (1), (2), (3) can lead to (4),
Thus, combining (1), (2), (3), (5) $\Rightarrow\left\{\begin{array}{l}x=204, \\ y=240, \\ z=204, \\ w=168 .\end{array}\right.$
$\therefore$ There are 204 triangles with all three sides red.
There are 240 triangles with two red sides and one blue side.