The cirumradius and the inradius of triangle $ABC$ are equal to $R$ and $r, O, I$ are the centers of respective circles. External bisector of angle $C$ intersect $AB$ in point $P$. Point $Q$ is the projection of $P$ to line $OI$. Find distance $OQ.$

(A.Zaslavsky, A.Akopjan) 
1. **Identify the given elements and their relationships:**
   - The circumradius \( R \) and the inradius \( r \) of triangle \( ABC \) are given.
   - \( O \) and \( I \) are the centers of the circumcircle and incircle, respectively.
   - The external bisector of angle \( C \) intersects \( AB \) at point \( P \).
   - Point \( Q \) is the projection of \( P \) onto the line \( OI \).

2. **Consider the excentral triangle \( I_aI_bI_c \):**
   - The excentral triangle is formed by the excenters of \( \triangle ABC \).
   - Let \( J \) be the circumcenter of the excentral triangle \( I_aI_bI_c \).
   - It is known that \( J \) and \( I \) are symmetric with respect to \( O \).

3. **Use the radical axis theorem:**
   - The line \( PQ \) is the radical axis of the circumcircles of \( \triangle ABC \) and \( \triangle I_aI_bI_c \).
   - The radical axis theorem states that the power of a point with respect to two circles is equal along their radical axis.

4. **Set up the equation using the radical axis theorem:**
   - The power of point \( Q \) with respect to the circumcircle of \( \triangle ABC \) is \( OQ^2 - R^2 \).
   - The power of point \( Q \) with respect to the circumcircle of \( \triangle I_aI_bI_c \) is \( QJ^2 - 4R^2 \) (since the circumradius of \( \triangle I_aI_bI_c \) is \( 2R \)).

   Therefore, we have:
   \[
   OQ^2 - R^2 = QJ^2 - 4R^2
   \]

5. **Simplify the equation:**
   \[
   OQ^2 - R^2 = QJ^2 - 4R^2
   \]
   \[
   OQ^2 + 3R^2 = QJ^2
   \]

6. **Express \( QJ^2 \) in terms of \( OQ \) and \( OJ \):**
   - Since \( J \) and \( I \) are symmetric with respect to \( O \), the distance \( OJ \) is twice the distance \( OI \), i.e., \( OJ = 2OI \).
   - Using the Pythagorean theorem in the right triangle formed by \( O, Q, J \):
     \[
     QJ^2 = OQ^2 + 2OQ \cdot OJ + OJ^2
     \]

7. **Substitute \( OJ = 2OI \) and simplify:**
   \[
   OQ^2 + 3R^2 = OQ^2 + 2OQ \cdot 2OI + (2OI)^2
   \]
   \[
   OQ^2 + 3R^2 = OQ^2 + 4OQ \cdot OI + 4OI^2
   \]

8. **Solve for \( OQ \):**
   - Since \( OI = \sqrt{R^2 - 2Rr} \) (a known relationship in triangle geometry):
     \[
     OQ^2 + 3R^2 = OQ^2 + 4OQ \cdot \sqrt{R^2 - 2Rr} + 4(R^2 - 2Rr)
     \]
   - Simplify the equation:
     \[
     3R^2 = 4OQ \cdot \sqrt{R^2 - 2Rr} + 4R^2 - 8Rr
     \]
     \[
     3R^2 - 4R^2 + 8Rr = 4OQ \cdot \sqrt{R^2 - 2Rr}
     \]
     \[
     -R^2 + 8Rr = 4OQ \cdot \sqrt{R^2 - 2Rr}
     \]
     \[
     OQ = \frac{-R^2 + 8Rr}{4\sqrt{R^2 - 2Rr}}
     \]

9. **Simplify the final expression:**
   \[
   OQ = \frac{2R^2 + 2Rr}{\sqrt{R^2 - 2Rr}}
   \]

The final answer is \(\boxed{\frac{2R^2 + 2Rr}{\sqrt{R^2 - 2Rr}}}\)