OFFSET
0,1
COMMENTS
See A322004 for the indices of the corresponding Fibonacci numbers, and further information.
LINKS
Robert Israel, Table of n, a(n) for n = 0..1958
EXAMPLE
a(0) = 2 is the smallest prime p such that p + 0 (= 2) is a Fibonacci number.
a(1) = 2 is the smallest prime p such that p + 1 (= 3) is a Fibonacci number.
a(2) = 3 is the smallest prime p such that p + 2 (= 5) is a Fibonacci number.
MAPLE
f:= proc(n) local p, k, a, b, c;
a:= -n:b:= 1-n:
do
c:= b;
b:= a+b+n;
a:= c;
if isprime(b) then return b fi
od
end proc:
map(f, [$0..80]); # Robert Israel, Dec 14 2018
MATHEMATICA
primeQ[n_] := n>0 && PrimeQ[n]; a[n_] := Module[{i=2}, While[!primeQ[Fibonacci[i] - n], i++]; Fibonacci[i] - n]; Array[a, 27, 0] (* Amiram Eldar, Dec 12 2018 *)
PROG
(PARI) a(n)=for(i=1, oo, ispseudoprime(fibonacci(i)-n)&&return(fibonacci(i)-n))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Dec 12 2018
STATUS
approved