Let $n = 2188 = 3^7+1$ and let $A_0^{(0)}, A_1^{(0)}, ..., A_{n-1}^{(0)}$ be the vertices of a regular $n$-gon (in that order) with center $O$ . For $i = 1, 2, \dots, 7$ and $j=0,1,\dots,n-1$, let $A_j^{(i)}$ denote  the centroid of the triangle \[ \triangle A_j^{(i-1)} A_{j+3^{7-i}}^{(i-1)} A_{j+2 \cdot 3^{7-i}}^{(i-1)}. \] Here the subscripts are taken modulo $n$. If \[ \frac{|OA_{2014}^{(7)}|}{|OA_{2014}^{(0)}|} = \frac{p}{q} \] for relatively prime positive integers $p$ and $q$, find $p+q$.

[i]Proposed by Yang Liu[/i]
1. **Convert the problem to the complex plane:**
   - Let $\omega = \operatorname{cis}\left(\frac{2\pi}{n}\right)$, where $\operatorname{cis}(\theta) = \cos(\theta) + i\sin(\theta)$.
   - The vertices of the regular $n$-gon can be represented as $A_j^{(0)} = \omega^j$ for $j = 0, 1, \ldots, n-1$.

2. **Determine the centroid of the triangle:**
   - The centroid of a triangle with vertices $\alpha, \beta, \gamma$ is given by $\frac{\alpha + \beta + \gamma}{3}$.
   - For $i = 1$, the centroid $A_j^{(1)}$ is:
     \[
     A_j^{(1)} = \frac{\omega^j + \omega^{j+3^6} + \omega^{j+2 \cdot 3^6}}{3}
     \]

3. **Generalize the centroid calculation:**
   - For $i = 2$, the centroid $A_j^{(2)}$ is:
     \[
     A_j^{(2)} = \frac{\omega^j + \omega^{j+3^5} + \omega^{j+2 \cdot 3^5} + \ldots + \omega^{j+8 \cdot 3^5}}{9}
     \]
   - By induction, for $i = 7$, the centroid $A_j^{(7)}$ is:
     \[
     A_j^{(7)} = \frac{\omega^j + \omega^{j+1} + \omega^{j+2} + \ldots + \omega^{j+3^7-1}}{3^7}
     \]

4. **Simplify the expression:**
   - Notice that the sum of all $n$-th roots of unity is zero:
     \[
     \omega^0 + \omega^1 + \ldots + \omega^{n-1} = 0
     \]
   - Therefore, the sum $\omega^j + \omega^{j+1} + \ldots + \omega^{j+3^7-1}$ is a subset of the $n$-th roots of unity, and it sums to zero:
     \[
     \omega^j + \omega^{j+1} + \ldots + \omega^{j+3^7-1} = 0
     \]

5. **Calculate the magnitude:**
   - Since the sum is zero, we have:
     \[
     A_j^{(7)} = \frac{0 - \omega^{j-1}}{3^7} = -\frac{\omega^{j-1}}{3^7}
     \]
   - The magnitude of $A_j^{(7)}$ is:
     \[
     |A_j^{(7)}| = \left| -\frac{\omega^{j-1}}{3^7} \right| = \frac{1}{3^7}
     \]

6. **Compare magnitudes:**
   - Initially, $|OA_{2014}^{(0)}| = 1$.
   - Therefore, the ratio is:
     \[
     \frac{|OA_{2014}^{(7)}|}{|OA_{2014}^{(0)}|} = \frac{\frac{1}{3^7}}{1} = \frac{1}{3^7}
     \]
   - Since $3^7 = 2187$, we have:
     \[
     \frac{1}{3^7} = \frac{1}{2187}
     \]

7. **Find $p$ and $q$:**
   - Here, $p = 1$ and $q = 2187$, so $p + q = 1 + 2187 = 2188$.

The final answer is $\boxed{2188}$