0

Like in the title the following equation:

  1. $F(n)=F(n-1)+F(n-2)+f(n)$, with $F(0)=0, F(1)=1$
  2. $f(n)=f(n-1)+f(n-2)$, with $f(0)=0, f(1)=1$

I don't know how to solve this. The $f(n)$ is basically just $F(n)$, but then I have $$F(n)=F(n-1)+F(n-2)+F(n) \Rightarrow F(n-1)+F(n-2)=0$$ and I cannot go anywhere from this.

Ainsley H.
  • 17,823
  • 3
  • 43
  • 68
MatKravi
  • 21
  • 1
  • 3

3 Answers3

2

This is an old question, but I just wanted to point out a more general solution if you didn't know about the Fibonacci sequence.

This system is linear, so it can be written as a first-order matrix equation:

$$\displaystyle \begin{bmatrix}F(n + 1) \\ F(n) \\ f(n + 1) \\ f(n) \end{bmatrix} = \begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 0\end{bmatrix} \begin{bmatrix} F(n) \\ F(n-1) \\ f(n) \\ f(n-1) \end{bmatrix}$$

Note that we used the fact that $f(n) = f(n-1) + f(n-2)$ to fill out the top row.

That is:

$$\displaystyle \begin{bmatrix}F(n + 1) \\ F(n) \\ f(n + 1) \\ f(n) \end{bmatrix} = \begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 0\end{bmatrix}^{n} \begin{bmatrix} F(1) \\ F(0) \\ f(1) \\ f(0) \end{bmatrix}$$

Denote:

$$\displaystyle A = \begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 0\end{bmatrix}$$

To determine powers of $A$, we factorise $A$ into the form:

$$\displaystyle A = \Sigma D \Sigma^{-1}$$

where $\Sigma$ is any invertible matrix, and $D$ has a convenient closed form for $D^n$. If you can do that, then:

$$\displaystyle A^n = \Sigma D^n \Sigma^{-1}$$

The obvious thing to try is eigendecomposition, which would make $D$ a diagonal matrix, so to calculate $D^n$, you just raise its diagonal entries to the power of $n$.

Unfortunately, this system has repeated eigenvalues, so we can't do that. It does, however, have a Jordan-Chevalley decomposition:

$$\displaystyle A = \Sigma J \Sigma^{-1}$$

where:

$$\displaystyle \Sigma = \begin{bmatrix}\operatorname{-}\left( \frac{\sqrt{5}\operatorname{-}1}{2}\right) & 1 & \frac{\sqrt{5}\operatorname{+}1}{2} & 1\\ 1 & 0 & 1 & 0\\ 0 & \frac{\sqrt{5}\operatorname{+}5}{2} & 0 & \frac{\sqrt{5}\operatorname{+}5}{\sqrt{5}\operatorname{+}3}\\ 0 & \operatorname{-}\left( \frac{3 \sqrt{5}\operatorname{+}5}{2}\right) & 0 & \frac{3 \sqrt{5}\operatorname{-}5}{2}\end{bmatrix}$$

and:

$$J = \begin{bmatrix}\frac{1\operatorname{-}\sqrt{5}}{2} & 1 & 0 & 0\\ 0 & \frac{1\operatorname{-}\sqrt{5}}{2} & 0 & 0\\ 0 & 0 & \frac{\sqrt{5}\operatorname{+}1}{2} & 1\\ 0 & 0 & 0 & \frac{\sqrt{5}\operatorname{+}1}{2}\end{bmatrix}$$

Since $J$ is in Jordan normal form, it has a reasonably convenient formula for its powers:

$$J^n = \begin{bmatrix}\left(\frac{1-\sqrt{5}}{2}\right)^n & n\left(\frac{1-\sqrt{5}}{2}\right)^{n-1} & 0 & 0\\ 0 & \left(\frac{1-\sqrt{5}}{2}\right)^n & 0 & 0\\ 0 & 0 & \left(\frac{1+\sqrt{5}}{2}\right)^n & n \left(\frac{1+\sqrt{5}}{2}\right)^{n-1}\\ 0 & 0 & 0 & \left(\frac{1+\sqrt{5}}{2}\right)^n\end{bmatrix}$$

And so we can multiply all those matrices together to get a closed form:

$$\displaystyle F(n) = \frac{1}{5} \left( \frac{2}{\sqrt{5}} + n \frac{1 + \sqrt{5}}{2}\right) \left( \frac{1 + \sqrt{5}}{2}\right)^n + \frac{1}{5} \left( -\frac{2}{\sqrt{5}} + n \frac{1 - \sqrt{5}}{2}\right) \left( \frac{1 - \sqrt{5}}{2}\right)^n$$

Pseudonym
  • 24,523
  • 3
  • 48
  • 99
1

$f(n)$ is the well-known Fibonacci sequence.

Let $\alpha=\frac{1+\sqrt5}2$ be the golden ratio and $\phi=\frac{1-\sqrt5}2$. It is shown here that $$f(n)=(\alpha^n-\phi^{n})/\sqrt5$$


Gnasher729 conjectured that $F(n) \approx 0.72 * n * f(n)$. Following that clue, we can find the following identity holds for all cases we tested by trial and error. $$F(n)= nf(n) - (n-2)f(n-2) + (n-4)f(n-4) - (n-6)f(n-6) + \cdots$$ where the sequence of summands goes on as long as the summand makes sense.


How to prove that long formula? We can observe it implies for $n\ge2$, $$ F(n) = nf(n) - F(n-2).$$

Let us prove that simple recurrence relation of $F(n)$ by induction on $n$.

The base cases when $n=2$ and when $n=3$ is easy since f(2)=1, f(3)=2, F(2)=1+0+1=2 and F(3)=2+1+2=5.

Suppose it is true for $n\le k$, where $k\ge3$. $$\begin{aligned} F(k+1) =& F(k) + F(k-1) + f(k+1)\\ =& (kf(k) - F(k-2)) + ((k-1)f(k-1) - F(k-3)) + f(k+1)\\ =& k(f(k)+f(k-1))-f(k-1) - (F(k-2)+F(k-3)) + f(k+1)\\ =& kf(k+1)-f(k-1) - (F(k-1)-f(k-1)) + f(k+1)\\ =& (k+1)f(k+1)- F(k-1)\\ \end{aligned}$$

Now that we have proved that simple recurrence relation of $F(n)$, it is immediate to prove that long formula, which can also be stated succinctly as

$$F(n)=\sum_{0\le i\lt n, i\text{ even}}(-1)^{i/2}f(n-i)$$


Interested readers may enjoy the following exercises, roughly in the order of increasing difficulty.

Exercise 1. Given the above formulas for $f(n)$ and $F(n)$, show that $F(n)=\Theta(n\alpha^n)$.

Exercise 2. Given the above formulas for $f(n)$ and $F(n)$, show that $$\lim_{n\to\infty}\frac{F(n)}{n\alpha^n}= \frac1{1+\alpha^{-2}}\approx 0.7236$$

Exercise 3. Find a close formula for $F(n)$.

John L.
  • 39,205
  • 4
  • 34
  • 93
0

Oh hey, I think I figured it out. You’ve got:

f(n) = f(n−1) + f(n−2) — that’s just the usual Fibonacci sequence

F(n) = F(n−1) + F(n−2) + f(n) — so this one builds on itself and adds in Fibonacci at each step

It’s not a contradiction, just a kind of layered pattern.

A few values to show how it plays out:

f(n) = 0, 1, 1, 2, 3, 5, 8, …

F(n) = 0, 1, 2, 5, 10, 20, 38, …

So yeah, F(n) grows faster — like Fibonacci is adding fuel to its own fire. F(n) kind of rides on Fibonacci’s shoulders — it adds its own momentum and picks up speed.