The Fibonacci numbers are defined by the recurrence:
F0=0,F1=1,Fn=Fn−1+Fn−2forn≥2.
A closed form of this formula is given by Binet’s formula:
Fn=5ϕn−ψn,
where ϕ=21+5 and ψ=21−5 are the roots of the characteristic polynomial x2−x−1. There are many alternative proofs for this established fact, but the author’s favourite concerns generating functions. Suppose that we want to find G(x) such that:
G(x)=F0+F1x+F2x2+F3x3+⋯=n=0∑∞Fnxn
In this scenario, G is a generating function for the Fibonacci numbers - in other words, it is a formal power series whose coefficients are the Fibonacci numbers. We rewrite G by definition of Fibonacci numbers and then split the sums:
From which we can isolate G and substitute F1=1. Then, we factor the denominator.
G(x)=1−x−x2x=−(x+ϕ)(x+ψ)x=51(1−ϕx1−1−ψx1)
We can expand the geometric series for 1−ϕx1 and 1−ψx1:
G(x)=51(n=0∑∞ϕnxn−n=0∑∞ψnxn)
By definition of the generating function G(x), the coefficient of xn is Fn. Hence, we have:
Fn=5ϕn−ψn
Which concludes the proof. A few other facts follow from Binet’s formula, for example:
Fn=⌊5ϕn+21⌉
Where ⌊x⌉ denotes the nearest integer to x. This is a useful fact for approximating Fibonacci numbers, and it can be proven by noticing that ∣5ψn∣<21 for all n≥0. A formula that allows us to determine the largest Fibonacci number less than a given number x is:
n=⌊logϕ5(F+21)⌉
Another interesting corollary of Binet’s formula states the sufficient and necessary condition for a natural number to be a Fibonacci number: either of 5n2+4 or 5n2−4 must be a perfect square.
Where (p5) is the Legendre symbol. We prove this fact by introducing two auxiliary lemmas, the first of which gives 2n−1Fn as a sum of binomial coefficients, a result initially stated by Catalan:
2n−1Fn=52n−1(ϕn−ψn)25(1+5)n−(1−5)n
Notice how the (1−5)n and (1+5)n terms can be written as binomial expansions:
Further, if we subtract those expansions, the even terms cancel out, while the odd terms double:
(1+5)n−(1−5)n=2k=0∑⌊2n−1⌋(2k+1n)52k+1
Substituting into the original expression and simplifying, we obtain:
2n−1Fn=k≥0∑(2k+1n)5k
The limits of summation are irrelevant, as the binomial coefficients vanish for k>2n−1. The second lemma is as follows:
Fp≡5n(modp)forp=2n+1
Recall the previous result concerning 2pFp. Fermat’s Little Theorem states, given that p is prime and a is an integer not divisible by p, that:
ap−1≡1(modp)
From which we can deduce:
2p≡2(modp)
Hence:
2pFp≡2k≥0∑(2k+1p)5k(modp)
However, all (2k+1p) are divisible by p, except (pp)=1. Therefore:
2pFp≡2⋅5n(modp)
Via Fermat’s Little Theorem, we deduce that:
Fp≡5n(modp)
Coming back to the original statement, we begin by proving the edge cases: if p=2, then 2∣F3. On the other hand, if p=3, then 3∣F4. The statement 5∣F5 is trivial, as F5=5. We apply the second lemma to Fp:
Fp≡5(p−1)/2(modp)
Squaring both sides and applying Fermat’s little theorem states that:
Fp2≡5p−1≡1(modp)
Per Cassini’s identity - Fn−1Fn+1−Fn2=(−1)n - we can deduce that:
Fp−1Fp+1≡0(modp)
Hence either p∣Fp+1 or p∣Fp−1, but not both by definition of Fibonacci numbers. On the other hand, we the following holds due to quadratic reciprocity:
A conjecture due to John Selfridge is that if p is an odd number, and p≡±2(mod5), then p is prime if both 2p−1≡1(modp) and Fp+1≡0(modp) hold. A variety of primality tests have been conjectured based on this statement, like the PSW test or the Baillie-PSW test.