OFFSET
0,1
COMMENTS
The closest prime to F(n) -- next closest if F(n) itself is prime -- for n = 0, 1, 2, 3, 4, ...:
2, 2, 2, 3, 2, 3 or 7, 7, 11, 19 or 23, 31 or 37, 53, 83, 139 or 149, 229, 379, 607 or 613.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
EXAMPLE
a(0) = 2 because 2 is the closest prime to F(0) = 0, and 2-0 = 2.
a(1) = 1 because 2 is the closest prime to F(1) = 1, and 2-1 = 1.
a(3) = 1 because 3 is the closest prime to F(3) = 2 other than the prime F(3) = 2 itself, and 3-2 = 1.
MAPLE
MATHEMATICA
g[n_]:=Module[{fn=Fibonacci[n], a, b}, a=NextPrime[fn, -1]; b=NextPrime[fn]; Min[Abs[fn-a], Abs[b-fn]]]; Table[g[i], {i, 0, 100}] (* Harvey P. Dale, Jan 15 2011 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Aug 04 2009
EXTENSIONS
More terms from R. J. Mathar, Aug 06 2009, reformatted Aug 29 2009
STATUS
approved