Nested fractional denominator(up to infinity)calculation

Question:

$$4+{\displaystyle \frac{1}{2+{\displaystyle \frac{1}{1+{\displaystyle \frac{1}{3+{\displaystyle \frac{1}{1+{\displaystyle \frac{1}{2+{\displaystyle \frac{1}{8+{\displaystyle \frac{1}{\ddots}}}}}}}}}}}}}}=\sqrt{A}$$

Find the positive integer A in the equation above.

Details and assumptions

The pattern repeats 2, 1, 3, 1, 2, 8 infinitely, but 4 comes only once, i.e., at the beginning.

Question:

$$4+{\displaystyle \frac{1}{2+{\displaystyle \frac{1}{1+{\displaystyle \frac{1}{3+{\displaystyle \frac{1}{1+{\displaystyle \frac{1}{2+{\displaystyle \frac{1}{8+{\displaystyle \frac{1}{\ddots}}}}}}}}}}}}}}=\sqrt{A}$$

Find the positive integer A in the equation above.

Details and assumptions

The pattern repeats 2, 1, 3, 1, 2, 8 infinitely, but 4 comes only once, i.e., at the beginning.