OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
Prime 251 is a term, the gap to the previous prime 241 is 10 and the gap to the next prime 257 is 6 and both gaps are triangular numbers.
MAPLE
t:= proc(n) option remember; issqr(8*n+1) end:
q:= n-> isprime(n) and andmap(t, [n-prevprime(n), nextprime(n)-n]):
select(q, [$3..5000])[];
MATHEMATICA
t[n_] := IntegerQ@Sqrt[8n+1];
q[n_] := PrimeQ[n] && t[n-NextPrime[n, -1]] && t[NextPrime[n]-n];
Select[Range[3, 5000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 25 2022
STATUS
approved