Problem: In $\triangle ABC$ , the sides have integer lengths and $AB=AC$ . Circle $\omega$ has its center at the incenter of $\triangle ABC$ . An excircle of $\triangle ABC$ is a circle in the exterior of $\triangle ABC$ that is tangent to one side of the triangle and tangent to the extensions of the other two sides. Suppose that the excircle tangent to $\overline{BC}$ is internally tangent to $\omega$ , and the other two excircles are both externally tangent to $\omega$ . Find the minimum possible value of the perimeter of $\triangle ABC$

Solution: Before we start thinking about the problem, let’s draw it out;
[asy]  unitsize(1cm);   var x = 9;  pair A = (0,sqrt(x^2-1)); pair B = (-1,0); pair C = (1,0);  dot(Label("$A$",A,NE),A); dot(Label("$B$",B,SW),B); dot(Label("$C$",C,SE),C);  draw(A--B--C--cycle);   var r = sqrt((x-1)/(x+1));  pair I = (0,r); dot(Label("$I$",I,SE),I); draw(circle(I,r));   pair G = intersectionpoint(A--B,circle(I,r)); pair D = (0,0);  dot(Label("$G$",G,W),G); dot(Label("$D$",D,SSE),D);   draw(Label("$r$"),I--G,dashed);  var rA = sqrt((x+1)/(x-1));  pair IA = (0,-rA); dot(Label("$I_A$",IA,SE),IA); draw(circle(IA,rA));   pair AB = (-1-2/(x-1),-2rA); pair AC = (1+2/(x-1),-2rA);  draw(B--AB,EndArrow); draw(C--AC,EndArrow);   pair H = intersectionpoint(B--AB,circle(IA,rA)); dot(Label("$H$",H,W),H);   draw(Label("$r_{I_A}$"),IA--H,dashed);   var rB = sqrt(x^2-1);  pair IB = (x,rB); dot(Label("$I_B$",IB,SE),IB);  pair BC = (x+1,0); pair BA = (2/x,sqrt(x^2-1)+2(sqrt(x^2-1)/x));  draw(C--BC,EndArrow); draw(A--BA,EndArrow);   pair E = intersectionpoint(A--C,circle(IB,rB)); pair F = intersectionpoint(C--BC,circle(IB,rB));  dot(Label("$E$",E,SE),E); dot(Label("$F$",F,S),F);  draw(Label("$r_{I_B}$"),IB--F,dashed);   draw(circle(IB,rB));  draw(A--IA); draw(B--IB);  pair J = intersectionpoint(B--BA,circle(IB,rB));  dot(Label("$J$",J,W),J);   draw(circle(I,r+2rA));  pair W = intersectionpoint(B--F,circle(I,r+2rA));  dot(Label("$\omega$",W,SSE),W);   [/asy]
For the sake of space, I've drawn only 2 of the 3 excircles because the third one looks the same as the second large one because the triangle is isosceles. By the incenter-excenter lemma, $AII_A$ and $BII_B$ are collinear, $E$ is the tangent of circle $I_B$ to $AC$ $F$ is the tangent of that circle to the extension of $BC$ , and $J$ is the tangent of the circle to the extension of $BA$ . The interesting part of the diagram is circle $\omega$ , which is internally tangent to circle $I_A$ yet externally tangent to circle $I_B$ . Therefore, perhaps we can relate the radius of this circle to the semiperimeter of triangle $ABC$
We can see that the radius of circle $\omega$ is $2r_{I_A}+r$ using the incenter and A-excenter of our main triangle. This radius is also equal to $BI_B - BI - r_{I_B}$ from the incenter and B-excenter of our triangle. Thus, we can solve for each of these separately in terms of the lengths of the triangle and set them equal to each other to form an equation.
To find the left hand side of the equation, we have to first find $r$ and $r_{I_A}$ . Let $a = AB = AC, b = BD = DC,$ and $h = AD$ . Then since the perimeter of the triangle is $2a+2b$ , the semiperimeter is $a+b$
Now let's take a look at triangle $BDI$ . Because $BI$ is the angle bisector of $\angle B$ , by the angle bisector theorem, $\frac{AI}{ID} = \frac{BA}{BD} \implies \frac{h-r}{r} = \frac{a}{b}$ . Rearranging, we get $r = \frac{hb}{a+b}$
Take a look at triangle $AGI$ $AG = a - GB = a - BD = a-b$ $AI = h-r = \frac{ha}{a+b}$ (angle bisector theorem), and $GI = r = \frac{hb}{a+b}$ . Now let's analyze triangle $AHI_A$ $AH = AB + BH = AB+ BD = a+b$ $AI_A = h+r_{I_A}$ , and $HI_A = r_{I_A}$ . Since $\angle GAI = \angle HAI_A$ and $\angle IGA = \angle I_AHA = 90^{\circ}$ , triangle $AGI$ and $AHI_A$ are similar by AA. Then $\frac{r_{I_A}}{r} = \frac{h+r_{I_A}}{h-r} \implies r_{I_A} = r \cdot \frac{h+r_{I_A}}{h-r} = \frac{hb}{a+b} \cdot \frac{h+r_{I_A}}{\frac{ha}{a+b}} = \frac{b(h+r_{I_A})}{a}$ . Now, solving yields $r_{I_A} = \frac{hb}{a-b}$
Finally, the left hand side of our equation is \[\frac{2hb}{a-b} + \frac{hb}{a+b}\]
Now let's look at triangle $BFI_B$ . How will we find $BI_B$ ? Let's first try to find $BF$ and $I_BF$ in terms of the lengths of the triangle. We recognize:
$BF = BC + CF = BC + CK$ . We really want to have $CA$ instead of $CK$ , and $AK$ looks very similar in length to $DC$ , so let's try to prove that they are equal.
$BJ = BF$ , so we can try to add these two and see if we get anything interesting. We have: $BJ + BF = BA + AJ + BC + CF = BA + AE + BC + CE = BA + BC + CA$ , which is our perimeter. Thus, $BF = a+b$
Triangle $BDI$ is similar to triangle $BFI_B$ by AA, and we know that $BD = b$ , and $ID = r = \frac{hb}{a+b}$ , so thus $I_BF = BF \cdot \frac{ID}{BD} = (a+b) \cdot \frac{\frac{hb}{a+b}}{b} = \frac{hb}{b} = h$ . Thus, the height of this triangle is $h$ by similarity ratios, the same height as vertex $A$ . By the Pythagorean Theorem, $BI_B = \sqrt{(a+b)^2 + h^2}$ and by similarity ratios, $BI = \frac{b}{a+b} \cdot \sqrt{(a+b)^2 + h^2}$ . Finally, $r_{I_B} = I_BF = h$ , and thus the right hand side of our equation is \[\sqrt{(a+b)^2 + h^2} - \frac{b}{a+b} \cdot \sqrt{(a+b)^2 + h^2} - h = \sqrt{(a+b)^2 + h^2}(1 - \frac{b}{a+b}) - h = \sqrt{(a+b)^2 + h^2} \cdot \frac{a}{a+b} - h\]
Setting the two equal, we have \[\frac{2hb}{a-b} + \frac{hb}{a+b} = \sqrt{(a+b)^2 + h^2} \cdot \frac{a}{a+b} - h\]
Multiplying both sides by $(a+b)(a-b)$ we have $2hb(a+b) + hb(a-b) = \sqrt{(a+b)^2 + h^2} \cdot a(a-b) - h(a^2 - b^2)$
From here, let $b = 1$ arbitrarily; note that we can always scale this value to fit the requirements later. Thus our equation is $2h(a+1) + h(a-1) = \sqrt{(a+1)^2 + h^2} \cdot a(a-1) - h(a^2 - 1)$ . Now since $h = \sqrt{a^2 - b^2}$ , we can plug into our equation:
$2h(a+1) + h(a-1) = \sqrt{a² + 2a + 1 + a^2 - b^2 } \cdot a(a-1) - h(a^2 - 1)$ . Remembering $b = 1$
$\implies 2h(a+1) + h(a-1) = \sqrt{2a^2 + 2a} \cdot a(a-1) - h(a^2 - 1)$
$\implies 3ha + h + ha^2 - h = \sqrt{2a^2 + 2a} \cdot a(a-1)$
$\implies ah(3+a) = a(a-1) \cdot \sqrt{2a^2 + 2a}$
$\implies h^2(3+a)^2 = (a-1)^2 \cdot 2a(a+1)$
$\implies (a^2 - 1) (3 + a)^2 = 2a(a+1)(a - 1)^2$
$\implies (3+ a)^2 = 2a(a-1)$
$\implies 9 + 6a + a^2 = 2a^2 - 2a$
$\implies a^2 - 8a - 9 = 0$
$\implies (a-9)(a+1) = 0$
$\implies a = 9$ because the side lengths have to be positive numbers. Furthermore, because our values for $a$ and $b$ are relatively prime, we don't have to scale down our triangle further, and we are done. Therefore, our answer is $2a + 2b = 18 + 2 = \boxed{020}$

Answer:  020