# Number of monomials in $a_n=a_{n-1}+(a_{n-2})^2$ with $a_1=a$, $a_2=b$

I was playing around with the sequence $a_1=a$, $a_2=b$ and the recurrence $a_n=a_{n-1}+(a_{n-2})^2$ and just listed out a few general terms.

For instance, $a_1=a$, $a_2=b$, $a_3=b+a^2$, $a_4=b+b^2+a^2$, $a_5=a^4+2a^2b+a^2+2b^2+b$, and $a_6=b^4+2b^3+3b^2+2a^2b^2+4a^2b+b+2a^4+a^2.$

When I did that, I realized that the number of terms in $a_n$ appears to be $F_n$ where $F$ represents the Fibonacci numbers. I conjecture that this is true, but I am not sure how to even approach this.

• This is not clear. First of all, you use $n$ to mean two different things. Then, you start with $k,n$ as constants and then switch to $a,b$ (I am guessing here). – lulu Jul 19 '17 at 2:14
• the OP also got $a_3$ wrong it's $n+k^2$ – user451844 Jul 19 '17 at 2:21

What an interesting question! The sequence of the number of monomial terms is $1,1,2,3,5,8,14,24,44,80,152,288,560,1088,2144,\dots$ -- not Fibonacci. For example $a_7$ = $b + 4 b^2 + 6 b^3 + 5 b^4 + a^2 + 6 b a^2 + 10 b^2 a^2 + 8 b^3 a^2 + 3 a^4 + 6 b a^4 + 8 b^2 a^4 + 2 a^6 + 4 b a^6 + a^8$ has 14 terms. The sequence is now in the OEIS as sequence A290075. A recursion for the number of terms is $b_n = 2 b_{n-1} +2 b_{n-2} -4 b_{n-3}$ for $n\ge 6$ and there is more information in the OEIS link.
• probably the last recurrence is meant to refer to the number of terms $(N_n)$ not to the original sequence in $a$ ? – G Cab Jul 19 '17 at 11:39
• @G Cab Yes, I edited my answer to use a different name $b_n$. – Somos Jul 19 '17 at 11:42
• @Kai Williams Actually, there is. The structure of the terms is triangular with even/odd parity variation but no contant term. For example, $a_4=a^2+...+b^2$, $a_6=2a^4+...+b^4$, and so on, while $a_5=a^4+...+2b^2$, $a_7=a^8+...+5b^4$, and so on. – Somos Jul 19 '17 at 21:21