OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Zak Seidov, A001223: maxima of 2nd order
MAPLE
P:= select(isprime, [2, seq(i, i=3..1000, 2)]):
DP:= P[2..-1] - P[1..-2]:
J:= select(t -> DP[t] > DP[t-1] and DP[t] > DP[t+1], [$2..nops(DP)-1]):
DP[J]; # Robert Israel, Mar 07 2024
MATHEMATICA
nn = 1001; t = Differences[Prime[Range[nn]]]; t2 = {}; Do[If[t[[n - 1]] < t[[n]] && t[[n]] > t[[n + 1]], AppendTo[t2, {n, t[[n]]}]], {n, 2, nn - 2}]; Transpose[t2][[2]] (* T. D. Noe, Dec 27 2011 *)
Select[Partition[Differences[Prime[Range[400]]], 3, 1], #[[1]]<#[[2]]>#[[3]]&][[;; , 2]] (* Harvey P. Dale, Mar 07 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Oct 29 2011
STATUS
approved