OFFSET
3,4
COMMENTS
Indices where a(n)= 0 are provided by A001605.
LINKS
Robert Israel, Table of n, a(n) for n = 3..1251
FORMULA
EXAMPLE
3 +- 0 -> primes, 5 +- 0 -> primes, 8 +- 3 -> primes, 13 +- 0 -> primes, 21 +- 2 -> primes, ...
MAPLE
A047160 := proc(n) for k from 0 to n-1 do if isprime(n-k) and isprime(n+k) then return k; end if; end do: return -1 ; end proc:
MATHEMATICA
f[n_] := Block[{k}, If[n==2||OddQ[n], k=0, k=1]; While[!PrimeQ[n-k] || !PrimeQ[n+k], k+=2]; k]; Table[f[Fibonacci[n]], {n, 3, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, May 09 2010
STATUS
approved