OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
Prime 10007 is a term, the gap to the previous prime 9973 is 34 and the gap to the next prime 10009 is 2 and both gaps are Fibonacci numbers.
MAPLE
f:= proc(n) option remember; (t-> issqr(t+4) or issqr(t-4))(5*n^2) end:
q:= n-> isprime(n) and andmap(f, [n-prevprime(n), nextprime(n)-n]):
select(q, [$3..150000])[];
MATHEMATICA
f[n_] := f[n] = With[{t = 5n^2}, IntegerQ@Sqrt[t+4] || IntegerQ@Sqrt[t-4]];
q[n_] := PrimeQ[n] && f[n-NextPrime[n, -1]] && f[NextPrime[n]-n];
Select[Range[3, 150000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 25 2022
STATUS
approved