OFFSET
1,1
COMMENTS
The difference F(i)-F(j) equals the sum F(j-1)+...+F(i-2) [Corrected by Patrick Capelle, Mar 01 2008]. In general, we need gcd(i,j)=1 for F(i)-F(j) to be prime. The exceptions are handled by the following rule: if i and j are both even or both odd, then F(i)-F(j) is prime if either (1) i-j=4 and L(i-2) is a Lucas prime or (2) i-j=2 and F(i-1) is a Fibonacci prime.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
EXAMPLE
The prime 139 is here because it is F(12)-F(5).
MATHEMATICA
lst={}; Do[p=Fibonacci[n]-Fibonacci[i]; If[PrimeQ[p], AppendTo[lst, p]], {n, 2, 40}, {i, n-1}]; Union[lst]
Select[Union[Flatten[Differences/@Subsets[Fibonacci[Range[50]], {2}]]], PrimeQ] (* Harvey P. Dale, Aug 04 2024 *)
PROG
(PARI) list(lim)=my(v=List(), F=vector(A130233(lim), i, fibonacci(i)), s, t); for(i=1, #F, s=0; forstep(j=i, 1, -1, s+=F[j]; if(s>lim, break); if(isprime(s), listput(v, s)))); Set(v) \\ Charles R Greathouse IV, Oct 07 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Oct 17 2005
STATUS
approved