Wednesday, 10 June 2020

Fibonacci-like Sequences

I've posted a lot about Fibonacci numbers over the years:
The Fibonacci sequence is the most famous example of a generalised sequence that begins with two seed numbers \( a \) and \( b \) and then proceeds as follows:$$ a_n=\begin{cases}a&\mbox{if }n=0;\\b&\mbox{if }n=1;\\a_{n-1}+a_{n-2}&\mbox{otherwise.}\end{cases} $$No matter what the values of the seed numbers, the ratio of one term to its predecessor always approaches \( \phi \), the golden ration. This ratio is equal to: $$ \frac{1+\sqrt{5}}{2}$$There is an even more generalised sequence that also begins with two seed numbers \( a \) and \( b \) but then proceeds as follows:$$ a_n=\begin{cases}a&\mbox{if }n=0;\\b&\mbox{if }n=1;\\A \, a_{n-1}+ B \, a_{n-2}&\mbox{otherwise.}\end{cases} $$Here \(A\) and \(B\) are constants and in the case where \(A=1\) and \(B=1\), we have the earlier sequence. The ratio of one term to its predecessor however, is no longer the golden ratio. The \(n\)-th term for such a sequence is given by:$$\frac{ \alpha^n- \beta^n}{\alpha-\beta}$$Here \( \alpha \) and \( \beta \) are the roots of the quadratic \(x^2=Ax+B\). Let's take a specific example where \(A=3\) and \(B=3\) and so \(x^2=3x+3\). The solution to this is:$$\alpha=\frac{3+\sqrt{21}}{2} \text{ and } \beta=\frac{3-\sqrt{21}}{2}$$Thus the \(n\)-th term approaches:$$\frac{(3+\sqrt{21})^n- (3-\sqrt{21})^n}{2^n \times \sqrt{21}}$$This simplifies to:$$\frac{1}{\sqrt{21}}\, \left(\frac{3+\sqrt{21}}{2}\right)^n$$Thus the ratio between successive terms will tend to \( \displaystyle \frac{3+\sqrt{21}}{2}\)

In the case where \(A=1\) and \(B=1\), the ratio is  \( \displaystyle \frac{1+\sqrt{5}}{2}=\phi\) and so different surds will appear depending on the values of \(A\) and \(B\).

As we've seen in the case of \(A=3\) and \(B=3\), the surd turns out to be \( \sqrt{21} \). Here is an example of an OEIS sequence with seed numbers \(a_0=1\) and \(a_1=2\) that has both constants equal to 3:



a(n) = 3*a(n-1) + 3*a(n-2) with a(0)=1 and a(1)=2           


The first terms of the sequence are 1, 2, 9, 33, 126, 477, 1809, 6858, 26001, 98577, 373734, 1416933, ... Naturally the terms get larger far more quickly than the Fibonacci sequence. Note that the ratio of the last two terms is getting close to the predicted value:$$\frac{1416933}{373734} \approx 3.79128738621586 \text{ and } \frac{3+\sqrt{21}}{2} \approx 3.79128784747792$$A further point to note is that the formula: $$\frac{ \alpha^n- \beta^n}{\alpha-\beta}$$only produces the correct terms of the sequence when a(0)=0 and a(1)=1 and the result is rounded to the nearest whole number. See permalink. However, no matter what the seed numbers, the ratio of terms for a particular sequence always approaches the same limit.

No comments:

Post a Comment