First, we note that we cannot have $n \leq 6$, since the first $6$ letters are $\text{X's}.$
After $\text{6 X's}$ and $\text{3 Y's}$, there are twice as many $\text{X's}$ as $\text{Y's}.$ In this case, $n=6+3=9$.
After $\text{6 X's}$ and $\text{12 Y's},$ there are twice as many $\text{Y's}$ as $\text{X's}.$ In this case, $n=6+12=18$.
The next letters are all $\text{Y's}$ (with $\text{24 Y's}$ in total), so there are no additional values of $n$ with $n \leq 6+24=30$.
At this point, there are $6 \mathrm{X}$ 's and $24 \;\text{Y's}.$
After $\text{24 Y's}$ and $\text{12 X's}$ (that is, $6$ additional $\text{X's}),$ there are twice as many $\text{Y's}$ as $\text{X's}$. In this case, $n=24+12=36$.
After $\text{24 Y's}$ and $\text{48 X's}$ (that is, $42$ additional $\text{X's}),$ there are twice as many $\text{X's}$ as $\text{Y's}.$ In this case, $n=24+48=72$.