# Are there any Fibonacci numbers that are sandwiched between twin primes?

Note: These queries had come up during an earlier discussion: On Fibonacci numbers that are also highly composite. Am putting them up as a separate post.

Q: Are there any Fibonacci numbers that are sandwiched between twin primes? An observation: none of the first 30 odd Fibonacci numbers is sandwiched between twin primes.

• Can you find a Fibonacci number $F_n>10$ for which $F_{n}+1$ is a prime? Dec 31, 2022 at 11:37
• Heuristically, $F_{n}\pm 1$ are simultaneously primes with probability $\asymp 1/n^2$ since $F_n$ grows exponentially and the density of primes is $1/\log x$. The convergence of $1/n^2$ suggests a finite number of such sandwiched Fibonaccis. Twin primes $(p,p+2)$ must satisfy $p\equiv -1 \bmod 6$, so a sandwiched Fibonacci number must be divisible by $6$. Since $F_n$ is periodic modulo $6$, a short computation shows $F_n \equiv 0 \bmod 6$ if and only if $n \equiv 0 \bmod 12$. I couldn't even find $n$ for which not both $F_{12n}-1,F_{12n}+1$ are composite. Dec 31, 2022 at 11:38
• Please restrict to one question per post. This is standard policy on this website. Dec 31, 2022 at 14:48
• Sure. Moved qn 2 to another post Dec 31, 2022 at 18:47
• Why, please, are you Asking that without Posting helpful research? After which number did you give up your own search? Jan 1, 2023 at 4:05

(In collaboration with Z. Chase.) A Fibonacci number $$F_{n}$$ is never sandwiched between two twin primes $$(p,p+2)$$.

This is because this would require $$F_{n}+1$$ to be a prime, but that can only happen iff $$n=1,2,3$$, and one can check that $$F_{n}-1$$ is not a prime in these cases.

The fact that $$F_{n}+1$$ is a prime iff $$n=1,2,3$$ is probably quite old. One reference is this OEIS page, where (the) Richard Guy shows

1. $$F_{4n}+1 = F_{2n-1} L_{2n+1}$$,
2. $$F_{4n+1}+1 = F_{2n+1} L_{2n}$$,
3. $$F_{4n+2}+1 = F_{2n+2} L_{2n}$$,
4. $$F_{4n+3}+1 = F_{2n+1} L_{2n+2}$$

where $$L_n$$ is the $$n$$th Lucas number.

In fact, we only need the first of these identities for your question, because if $$F_{n}$$ is sandwiched between twin primes $$(p,p+2)$$ then $$F_n \equiv 0 \bmod 6$$ implying $$n \equiv 0 \bmod 12$$.

• Empirically (this is certainly known too) $F_{2n}$ divides $F_{4n+2}-1$, $F_{4n+1}-1$, $F_{4n-1}-1$ and $F_{2n+1}$ divides $F_{4n}-1$ for all $n$. For $n\ge 2$, the divisor is $\ge 2$ and smaller than the larger number, and hence in this way we see that $F_m-1$ is also non-prime for all $m\ge 7$. (Thus $F_m-1$ is prime only for $m=4,6$, namely equals $2,7$).
– YCor
Dec 31, 2022 at 19:52
• @YCor Cool! Indeed, from your empirical observations and Guy's identities one might guess $F_{4n+2\varepsilon}-1 = F_{2n-1+\varepsilon} L_{2n+1+\varepsilon}$ ($\varepsilon=0,1$) and $F_{4n\pm 1}-1= F_{2n} L_{2n \pm1}$ hold, both of which are easily confirmed (and surely known -- yes, I checked the OEIS page oeis.org/A000071 and they are stated by Peter Bala). We see $F_m\pm 1$ are both composite for $m \ge 7$. (The OEIS page also contains the statement that $2$ and $7$ are the only primes in the sequence.) Dec 31, 2022 at 20:21