Given $a_1,a_{100}, a_i=a_{i-1}a_{i+1}$, what's $a_1+a_2$? I've been given the following puzzle

Let $a_1, a_{100}$ be given real numbers. Let $a_i=a_{i-1}a_{i+1}$ for $2\leq i \leq 99$. Further suppose that the product of the first $50$ is $27$, and the product of all the $100$ numbers is also $27$.
Find $a_1+a_2$.

I tried the following, looking at the sequence for a moment we see:
$$
a_2=a_1\, a_3\\
a_3=a_2\,a_4\\
\vdots\\
a_{99}=a_{98}\,a_{100}
$$
So $$a_2=\frac 1 {a_{99}} \prod_i a_i =\frac {27}{a_{99}}$$
Looking at the other elements, we find that $$a_3=\frac {a_2} {a_1}, a_4=\frac {a_2}{a_1 a_2}, a_5=\frac {a_2}{a_1a_2a_3},\dots , a_n=\frac {a_2}{\prod_{i=1}^{n-2} a_i}$$
Then, $$27=\prod_i a_i=\prod_{1\leq i\leq 100} \frac {a_2}{\prod_{k=1}^{i-1}a_i}$$
The last product I believe is much more complicated than what I should have gotten... 
Has anyone ran into this puzzle before?
 A: Note that since $a_i=a_{i-1}a_{i+1}$, then, for $i\geqslant 3$, we also have $a_{i-1}=a_{i-2}a_i$. Plug this in the first formula, we have $a_i=a_{i-2}a_ia_{i+1}\Rightarrow a_{i-2}a_{i+1}=1\Rightarrow a_{i+3}=\frac{1}{a_i}.$
Then, the sequence is in the form of $a_1=a,a_2=ab,a_3=b,a_4=\frac{1}{a},a_5=\frac{1}{ab},a_6=\frac{1}{b},a_7=a,\dots$.
$a_{i+6}=a_i$. So $a_{50}=ab$ and $a_{100}=\frac{1}{a}$. Hence, $1=\prod_{i=51}^{100}=\frac{b}{a}\Rightarrow a=b$. Also, $27=\prod_{i=1}^{50}=a\cdot (ab)=a^3\Rightarrow a=3\Rightarrow a_1+a_2=3+9=12$.
A: Such a sequence is periodic with period length 6, one cycle
$$ A, B, \frac{B}{A},  \frac{1}{A},  \frac{1}{B},  \frac{A}{B} $$
Note that the product of all six is $1.$  Therefore the product of the first 96 is one, and 27 is $\frac{B^2}{A}.$ The product of the first 48 is one, and 27 is also $AB.$ That is
$$ 27 A = B^2, $$
$$  27  = AB.$$
From $$ 729 = 27AB = (27A)B = B^3$$ I get $729 = B^3 $ and
$$ B = 9. $$ Then
$$ A = 3. $$
The sum is $$ A + B =12.  $$
The cycle of length six becomes
$$  3, \; 9,  \; 3, \;  \frac{1}{3}, \;  \frac{1}{9}, \;  \frac{1}{3}.  $$
Putting two together shows
$$  3, \; 9,  \; 3, \;  \frac{1}{3}, \;  \frac{1}{9}, \;  \frac{1}{3}, \; 3, \; 9,  \; 3, \;  \frac{1}{3}, \;  \frac{1}{9}, \;  \frac{1}{3}  $$
In the original notation, with cycles of six multiplying to one, we have
$$ a_{49} a_{50} = a_1 a_2 = 3 \cdot 9 = 27.  $$
Also
$$ a_{97} a_{98} a_{99} a_{100} = a_1 a_2 a_3 a_4 = 3 \cdot 9 \cdot  3 \cdot  \frac{1}{3}  = 27.  $$
A: Since the product of all the numbers is nonzero, the numbers are all nonzero, which means we can write them as $a_i=3^{b_i}$ (where $b_i$ is potentially complex, although we'll see it never is).  The recursion translates to $b_{i+1}=b_i-b_{i-1}$, which in turn implies $b_{i+3}=-b_i$ for $i=1,2,\ldots,97$, so that the sequence of $100$ $b_i$'s is just
$$b_1,b_2,b_3,-b_1,-b_2,-b_3,b_1,b_2,b_3,\ldots,b_1,b_2,b_3,-b_1$$
The product of the first $50$ $a$'s corresponds to the sum of the first $50$ $b$'s, which, after cancellations, is just $b_1+b_2$, so we have
$$b_1+b_2=3$$
Similarly, the sum of all $100$ $b$'s reduces to $b_2+b_3$, so we have
$$b_2+b_3=3$$
Putting this together with $b_3=b_2-b_1$, we find $b_1=1$ and $b_2=2$, which means
$$a_1+a_2=3^1+3^2=12$$
