Adjust the Fibonacci function for different initial conditions

If you have $$G_n=G_{n-1}+G_{n-2} \qquad \text{with} \qquad G_1=a \qquad \text{and} \qquad G_2=b$$ the general formula is given by $$G_n=\frac{1}{2} \left((3 a-b) F_n+(b-a) L_n\right)$$ where appear the usual Fibonacci and Lucas numbers.

For $a=50$ and $b=100$, the sequence would be $$\{50,100,150,250,400,650,1050,1700,2750,4450,7200,11650,18850,30500,49350\}$$

If you divide all numbers by $10$, this becomes sequence $A022088$ in $OEIS$


If a sequence $(G_n)$ is given by $G_1=a$, $G_2=b$, $G_n=G_{n-1}+G_{n-2}$ for $n\ge 3$, then $$G_n=a F_n + (b-a) F_{n-1}$$ where $F_n$ is the $n$-th Fibonacci number, with $F_0=0$, $F_1=1$, $F_2=1$, etc.

Thus, your sequence is $G_n = 50 F_n + 50 F_{n-1} = 50 F_{n+1}$.

To find $n$ given $G_n$, adapt the formula you already know: $$ n = \bigg\lfloor \log_\varphi \left(\frac{G_n}{50}\cdot\sqrt{5} + \frac{1}{2} \right)\bigg\rfloor-1. $$ However, to apply this formula for large numbers, you'll probably need high-precision approximations of $\varphi$ and $\log$ to find $\log_\varphi(x)=\log(x)/\log(\varphi)$.


The recursion relation $F(n+2) = F(n+1)+F(n)$ suggests the generating function $x^2f(x) = xf(x)+f(x) \rightarrow f(x) = \frac 1 {x^2-x-1} = 1/[(x-\phi)(x+\phi^{-1})]$, where $\phi = \frac {1+\sqrt 5}2$. This fraction can be decomposed by partial fractions into $\frac A {x-\phi}+\frac B {x+\phi^{-1}}$. This is then two geometric sequences $A(\sum (\phi x)^n+B(\sum (-\phi^{_1})^n)$ or $\sum (A\phi^n+B(-\phi^{-1})^n)x^n$.

I've left $A$ and $B$ as variables rather than solving for them, as the above doesn't take into account the initial terms, and the values of $A$ and be $B$ will depend on those terms; when we plug those in, we have two unknowns ($A$ and $B$), and two constraints (the two initial terms). In fact, given any $a_{i},a_{j}$, we can solve for $A$ and $B$ with $A\phi^{i}+B(-\phi^{-1})^{i}=a_{i}$ and $A\phi^{j}+B(-\phi^{-1})^{j}=a_{j}$.

In the particular case you gave, we have that the standard Fibonacci sequence goes $0,1,1,2,3,5,8...$ (although conventions vary whether it starts with $0$ or $1$). Multiply these numbers by $50$ yields $0,50,50,100,150,250,400...$. Your numbers $50,100$ correspond to $a_2,a_3$ of that sequence (with zero indexing), and so if $b_n$ denotes the $n$-th number in your sequence (with $b_1 = 50$, $b_2=100$), and $F_n$ denotes the $n$-th number of the Fibonacci sequence ($F_0=0$, $F_1=1$, $F_2=1$, ...), then $b_n = 50F_{n+1}$.