$a+\dfrac{1}{b+\dfrac{1}{c}} = \frac{4016}{2007} , \qquad \dfrac{1}{c+\dfrac{1}{b+\dfrac{1}{a}}} = \dfrac{p}{q}$

Positive integers $a,b,c,p$ and $q$ satisfy the system of equations above. If $p$ and $q$ are coprime, submit your answer as $p+q$ .

The answer is 6023.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Relevant wiki: Fraction Arithmetic$\dfrac{4016}{2007}=2+\dfrac{1}{\frac{2007}{2}}=2+\dfrac{1}{1003+\frac{1}{2}}$ Thus by comparison, we get $a=c=1/2$ and $b=1003$ .Thus,

$\frac{1}{c+\frac{1}{b+\frac{1}{a}}} =\frac{1}{a+\frac{1}{b+\frac{1}{c}}}~~(\text{Since } a=c)$ Note this is the reciprocal of the first expression given in question and thus equals $\dfrac{2007}{4016}$ .Thus, $p + q = 6023$ .