Fibonacci like series - determination of 1st and 2nd element

96 Views Asked by At

Determining nth value of the Fibonacci series or Fibonacci like series is well known and easy to calculate. Can that be reversed?

Can we calculate 1st and 2nd element of the series by giving the value of nth element?

for example, for non Fibonacci series number: 1398 the first and second element of that series is 6: 6 6 12 18 30 48 78 126 204 330 534 864 1398

by knowing only 1398, are we able to compute that it is 13th element in the series where first two elements are 6 an 6?

2

There are 2 best solutions below

1
On

First, let's clarify that the thirteenth element in the recurrence is really $f_{12}$ since the first element is $f_0$. Now that said, I am assuming that by Fibonacci-like you mean that $f_n=f_{n-1}+f_{n-2}$, as opposed to the more general $f_n=af_{n-1}+bf_{n-2}$. The general solution to your Fibonacci-like equation is given by

$$ f_n=\bigg(f_1-\frac{f_0}{2}\bigg)F_n+\frac{f_0}{2}L_n $$

where

$$ F_n=\frac{\varphi^n-\psi^n}{\varphi-\psi}\\ L_n=\frac{\varphi^n+\psi^n}{\varphi+\psi} $$

where, of course, $\varphi,\psi=(1\pm\sqrt{5})/2$.

For your particular case, given $f_{12}=1398$, we seek to find $f_{0,1}$ from

$$ f_{12}=\bigg(f_1-\frac{f_0}{2}\bigg)F_{12}+\frac{f_0}{2}L_{12} $$

Alas, we have one equation in two unknowns, so we cannot find a solution unless $f_0=f_1$. I believe this will always give a solution, although it may turn out to be a non-integer.

8
On

The first two terms of the regular Fibonacci series (RFS) are $1$. A more general case is that the first two terms are positive integers $a$ and $b$ respectively. For convenience, we may call it "generalized Fibonacci series" (GFS), and denote its $n$-th term by $g_n$.

It is possible to find the first two term $a$ and $b$ of the GFS with the known $n$-th term as follows. When $n$ is sufficiently large, the ratio of two adjacent terms is well approximate to $c=\frac{1+\sqrt5}{2}\approx1.618034...$. Thus, for example, with given $g_{13}=1398$, we can get $g_{12}=round(1398/1.618034)=864$. Then by iterative subtractions, $g_{k}=g_{k+2}-g_{k+1}$, for $k=n-2, n-3, ..., 2,1$, we can finally get $(a,b)=(6,6)$ .

This method has a limitation that the value of $n$ for the known $g_n$ should be sufficiently large with respect to the initial values $(a,b)$. That means, if $a$ and $b$ are quite large, $n$ also needs to be quite large.

Below is another possible method to avoid this problem. While the $n$-th term of the regular Fibonacci series can be expressed as

$f_n=\frac{1}{\sqrt5}[(\frac{1+\sqrt5}{2})^n-(\frac{1-\sqrt5}{2})^n]$,

the $n$-th term of the generalized Fibonacci series can be expressed as

$g_n=af_{n-2}+bf_{n-1}$.

This is a linear Diophantine equation (DEQ) with known $g_n$, $f_{n-2}$ and $f_{n-1}$. For example, with $g_{13}=1398$, $f_{12}=144$, $f_{11}=89$, we have the DEQ

$89a+144b=1398$.

This DEQ has a unique positive integer solution for both $a$ and $b$, i.e., $(a,b)=(6, 6)$.