login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = least k such that the distance from Fibonacci(k) to the closest prime is n, or -1 if no such k exists.
0

%I #8 Jan 29 2022 13:26:13

%S 3,1,0,9,16,12,37,42,149,33,26,27,38,24,28,189,44,111,50,66,49,57,68,

%T 30,46,81,142,78,92,96,59,69,71,141,184,267,67,129,61,117,211,576,115,

%U 372,161,138,119,198

%N a(n) = least k such that the distance from Fibonacci(k) to the closest prime is n, or -1 if no such k exists.

%o (PARI) a(n)=if(n<0,0,s=1; while(abs(n-min(abs(precprime(fibonacci(s))-fibonacci(s)),abs(nextprime(fibonacci(s))-fibonacci(s))))>0,s++); s)

%Y Cf. A051699, A000045.

%K nonn

%O 0,1

%A _Benoit Cloitre_, Jan 26 2003

%E Changed "was found" to "exists" in definition. Offset was wrong. Adjusted initial terms. - _N. J. A. Sloane_, Jan 29 2022