# General term formula for combination of arithmetic and geometric progressions

Let $$a_n;\;n> 1$$ be a sequence of positive numbers such that $$a_1, a_2, a_3$$ are in $$AP$$, $$a_2, a_3, a_4$$ are in $$GP$$, $$a_3, a_4, a_5$$ are in $$AP$$, $$a_4, a_5, a_6$$ are in $$GP$$, and so on. Find an expression for $$a_n$$ in terms of $$a_1$$ and $$a_2$$.

I did
$$a_3=2a_2+a_1$$ $$a_4=a_2+a_1\bigg(\frac{1}{a_2}-4\bigg)$$ $$a_5=6a_2+a_1\bigg(\frac{2}{a_2}-7\bigg)$$ But I can't see how to write $$a_n$$ in terms of $$a_1$$ and $$a_2$$... Can somenone help me? Thanks for attention!

Apply induction to prove: $$a_n=\frac1{a_2}\times\begin{cases} \left(\frac{n+1}2a_2-\frac{n-1}2a_1\right)\left(\frac{n-1}2a_2-\frac{n-3}2a_1\right),& n\text{ odd},\\ \left(\frac{n}2a_2-\frac{n-2}2a_1\right)^2,& n\text{ even}. \end{cases}$$
• Nice job. Let me add, that a couple of conditions needs to be written up for cases that are not true with the above formula: I immediately thought seeing this that if all elements are equal, they satisfy the conditions. But if I plug $a_2 = a_1$ in the above, I get $a_1$ for odd, but $-a_1$ for even. And there might be other solutions like this (or not, I cannot prove...), hence the conditions I mention. – Dávid Laczkó May 28 at 15:15
• @DávidLaczkó I don't quite understand how $\frac{a^2}a=-a$ for even $n$. The only condition I see $a_2\ne0$. – user May 28 at 21:32
• @DávidLaczkó I just have changed the sign inside the brackets for beauty reasons. $(-1)^2=1$ still... :) – user May 29 at 6:03