7

Is there a formula for a Fibonacci sequence starting with any pair?

I know there is a formula for a Fibonacci sequence starting with $1, b$ but what if I want to start with $a, b$ as $3,4$ for example?

Thank you

Mark Bennet
  • 101,769

6 Answers6

8

Here is a way to think about it:

Let $f_0=0, f_1=1,f_2=1,...$ be the Fibonacci numbers, then if we start the same recursion for arbitrary starting values $a,b\in\mathbb{R}$, we get $$ g_0=a,g_1=b,g_2=a+b,g_3=a+2b,g_4=2a+3b,g_5=3a+5b,... $$ See the pattern? Apparently, the $n$-th term in the sequence is equal to $g_n=f_{n-1}a+f_nb$, which you can easily prove by induction. So no fancy maths is needed to reduce it to the ordinary fibonacci numbers; the fancy part begins by finding an explicit way of expressing $f_n$ in terms of $n$.

4

These types of sequences are called Lucas numbers. These numbers have similar properties to Fibonacci numbers, such that (the $n$th term)/(the $n-1$th term) is also equal to the golden ratio.

For example, the $n$th Lucas number $L_n$ equals $L_{n-1} + L_{n-1}$, $L_{n-2} + L_{n-2}$ which is the same as the Fibonacci sequence. Their closed form is differs by to the Fibonacci sequence by a factor of $\sqrt5$ (according to Wolfram MathWorld). Some Lucas numbers actually converge faster to the golden ratio than the Fibonacci sequence!

(The closed form of the Lucas numbers is $\frac{(1+\sqrt5)^n+(1-\sqrt5)^n}{2^n}$ and the closed form of the Fibonacci sequence is $\frac{(1+\sqrt5)^n+(1-\sqrt5)^n}{2^n\sqrt5}$).

Toby Mak
  • 17,073
2

Let $\alpha, \beta$ be the two roots of $x^2-x-1=0$ so that $$\alpha^2=\alpha+1$$ and multiplying through by $\alpha^n$ gives $$\alpha^{n+2}=\alpha^{n+1}+\alpha^n$$ and similarly $$\beta^{n+2}=\beta^{n+1}+\beta^n$$ Now take $A$ times the first equation plus $B$ times the second equation and put $u_n=A\alpha^n+B\beta^n$ to obtain $$u_{n+2}=u_{n+1}+u_n$$

Now suppose we have $u_0=X, u_1=Y$ where $X$ and $Y$ are arbitrary. Then $$X=A+B, Y=A\alpha+B\beta$$ so that $$A=\frac{Y-\beta X}{\alpha-\beta}; B=\frac{Y-\alpha X}{\beta-\alpha}$$ hence $$u_n=\frac{Y-\beta X}{\alpha-\beta}\alpha^n+\frac{Y-\alpha X}{\beta-\alpha}\beta^n$$

So this solves for $u_n$ for arbitrary starting values.

I have set this out so you can see how you can do the same with any quadratic equation and solve $u_{n+2}=p\cdot u_{n+1}+q\cdot u_n$ - for arbitrary $p$ and $q$. You might care to try to work out what happens when the equation has a double root. The method generalises to cubics and higher degrees to solve linear recurrences of any order.


If your starting values are taken as $u_1, u_2$ just note that you can use $u_0=u_2-u_1$

Mark Bennet
  • 101,769
2

If you're comfortable with linear algebra you can better understand the previous answers and get even more information from a particularly nice representation - plus it generalizes to many variations of the problem, including, say, adding the last $k$ numbers.

Suppose we want to start with values $a,b$. We can put them in a vector $(a,b)^t$, where the first value indicates the previous value, and the second indicates the current. Then if we multiply this vector by the matrix:

$$A = \begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}$$

we get $A (a,b)^t = (b, a+b)^t$. This matrix captures the update 'rules' for Fibonacci, and note it doesn't depend at all on the values of $a,b$. Fortunately, matrix multiplication is associative, so we can compute $A^k (a,b)^t$ to find the value of the $k$th value in our sequence in terms of $a,b$. This immediately tells us we should expect a linear combination of our first values, and a little analysis of powers of $A$ gives the right answer:

$$g_n = f_{n-1}a + f_{n-2} b$$

You can now do more - if you want $a_n = \alpha a_{n-1} + \beta a_{n-2}$ then you can use the matrix:

$$A_{\alpha, \beta} = \begin{pmatrix} 0 & 1 \\ \alpha & \beta \end{pmatrix}$$

And take powers of it to get the coefficients for $a_n$ in terms of the initial values. Likewise, we can find $A_{\alpha, \beta}$s eigenvalues (For Fibonacci: $\frac{1 \pm \sqrt{5}}{2}$) and eigenvectors (also for Fibonacci: $(\frac{1 \pm \sqrt{5}}{2},1)^t$) to find things like the limiting ratio of subsequent terms, or if the sequence is ever constant for any starting values.

Artimis Fowl
  • 1,960
1

Let us build the formula for any pair $(a,b)$ from

$$(a,b) = (1,0)a+(0,1)b$$

For initial conditions $(0, 1)$, the solution is

$$F_{0,1}(n)= \frac{(1+\sqrt{5})^n-(1-\sqrt{5})^n}{2^n\sqrt{5}}$$

For initial conditions $(1, 0)$, the solution is

$$F_{1,0}(n)= \frac{(1+\sqrt{5})^{n-1}-(1-\sqrt{5})^{n-1}}{2^{n-1}\sqrt{5}}$$

which are the Fibonacci numbers delayed one position: $1,0,1,1,2,3,5,8,...$ $$F_{1,0}(n)=F_{0,1}(n-1)$$ Finally, the general solution has closed form in terms of initial conditions $a,b$

$$\begin{align}F_{a,b}(n)&=aF_{1,0}(n)+bF_{0,1}(n)\\ &=\frac{(2a+b(1+\sqrt{5}))(1+\sqrt{5})^{n-1}-(2a+b(1-\sqrt{5}))(1-\sqrt{5})^{n-1}}{2^{n}\sqrt{5}}\\ \end{align}$$

0

What you need is a general equation that parameterizes the results for any generalized Fibonacci-type sequence in terms of the initial conditions.

There have been many extensions of the sequence with adjustable (integer) coefficients and different (integer) initial conditions, e.g., $f_n=af_{n-1}+bf_{n-2}$. (You can look up Pell, Jacobsthal, Lucas, Pell-Lucas, and Jacobsthal-Lucas sequences.) Maynard has extended the analysis to $a,b\in\mathbb{R}$, (Ref: Maynard, P. (2008), “Generalised Binet Formulae,” $Applied \ Probability \ Trust$; available at http://ms.appliedprobability.org/data/files/Articles%2040/40-3-2.pdf.)

We have extended Maynard's analysis to include arbitrary $f_0,f_1\in\mathbb{R}$. It is relatively straightforward to show that

$$f_n=\left(f_1-\frac{af_0}{2}\right) \frac{\alpha^n-\beta^n}{\alpha-\beta}+\frac{af_0}{2} \frac{\alpha^n+\beta^n}{\alpha+\beta}= \left(f_1-\frac{af_0}{2}\right)F_n+\frac{af_0}{2}L_n$$

where $\alpha,\beta=(a\pm\sqrt{a^2+4b})/2$, $F_n=\frac{\alpha^n-\beta^n}{\alpha-\beta}$, and $L_n=\frac{\alpha^n+\beta^n}{\alpha+\beta}$.

The result is written in this form to underscore that it is the sum of a Fibonacci-type and Lucas-type Binet-like terms. It will also reduce to the standard Fibonacci and Lucas sequences for $a=b=1, f_1=1, \text{ and } f_0=0 \text{ or }2$.

This can also be expressed as

$$f_n=f_1F_n+bf_0F_{n-1}$$

Cye Waldman
  • 8,196