3
$\begingroup$

Many years ago, I saw the following Fibonacci identity from somewhere online, without proof:

Let usual $F(n)$ be Fibonacci numbers with $F(0) = 0, F(1) = 1$, then we have

$$F(n) = \left(p ^ {n + 1} \bmod \left(p ^ 2 - p - 1\right)\right) \bmod p$$

where $p = 2 ^ {n + 1}$.

I couldn't find the source anymore, and it wouldn't help anyway as it didn't contain a proof. As far as I looked around Google search results this is not documented anywhere notable (e.g Wikipedia or here); Fibonacci identities with modulo are usually discussed under the topic of Pisano period, and never contains 2 modulo. However, it looks like it has something to do with the generating function.

Is there a proof for this identity, or are there any existing material where this identity is mentioned/proved?

Edit

There is a write-up on a very similar identity here, proven using generating function:

$$ F(n) = \left\lfloor\frac{p ^ {n + 1}} {p ^ 2 - p - 1}\right\rfloor \bmod p $$

They look almost the same but can't be more different! One is the quotient and one is the modulo. I'm not even sure if they are related to each other.

$\endgroup$
2
  • $\begingroup$ What does this double mod mean? $\endgroup$ Commented Feb 14 at 8:01
  • 1
    $\begingroup$ Take the modulo on the left, then the modulo on the right. I omitted the bracket because it's usually assumed to be left-associative. Anyways, edited for clarity. $\endgroup$
    – Voile
    Commented Feb 14 at 8:09

1 Answer 1

1
$\begingroup$

If you consider the inner expression in $\mathbb{Z}/(p^2-p-1)$, $$p^{n+1} \bmod (p^2 - p - 1) = F(n+1)p + F(n)$$ Proof by induction: with $n=0$ we have $p \bmod (p^2 - p - 1) = p = F(1)p + F(0)$. Then for the inductive step, \begin{eqnarray*}{(F(n+1)p + F(n))p} &=& {F(n+1)p^2 + F(n)p} \\ &=& {F(n+1)(p+1) + F(n)p} \\ &=& {F(n+2)p + F(n+1)}\end{eqnarray*}

Thus the identity $F(n) = (p^{n+1} \bmod (p ^ 2 - p - 1)) \bmod p$ holds for any $p > F(n)$.

$\endgroup$
2
  • $\begingroup$ I tested some values of $p$; it definitely works for any $p$ above a certain bound, but $p > F(n)$ is not enough. $p > F(n+2)$ would work, but I haven't proven the actual bound yet. $\endgroup$
    – Voile
    Commented Feb 15 at 8:10
  • $\begingroup$ @Voile, now that you mention it I have been a bit cavalier in the switch from $\mathbb{Z}/(p^2-p-1)$ treating $p$ as a variable to specific values of $p$. We might require $F(n+1)p + F(n) < p^2 - p - 1$, so which gives a bound of approximately $\frac12 F(n+2) + F(\frac n2)$. $\endgroup$ Commented Feb 15 at 8:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .