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”).
%I #24 Mar 08 2024 02:33:25
%S 4,4,6,6,6,6,8,4,14,6,10,10,4,6,10,6,14,14,10,8,8,10,10,6,8,12,8,12,
%T 18,10,10,12,12,10,10,8,8,14,12,10,4,14,14,20,10,14,8,12,6,10,10,10,
%U 18,8,22,10,10,12,12,18,6,6,12,34,18,14,8,12,4,12,8,8
%N Values of local maxima in differences of primes, A001223.
%H Robert Israel, <a href="/A198697/b198697.txt">Table of n, a(n) for n = 1..10000</a>
%H Zak Seidov, <a href="/A198697/a198697_1.png">A001223: maxima of 2nd order</a>
%p P:= select(isprime,[2,seq(i,i=3..1000,2)]):
%p DP:= P[2..-1] - P[1..-2]:
%p J:= select(t -> DP[t] > DP[t-1] and DP[t] > DP[t+1], [$2..nops(DP)-1]):
%p DP[J]; # _Robert Israel_, Mar 07 2024
%t 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 *)
%t Select[Partition[Differences[Prime[Range[400]]],3,1],#[[1]]<#[[2]]>#[[3]]&][[;;,2]] (* _Harvey P. Dale_, Mar 07 2023 *)
%Y Cf. A198696 (positions of local maxima in A001223).
%Y Cf. A196175 (positions of local minima in A001223).
%Y Cf. A001223 (first differences of primes).
%K nonn
%O 1,1
%A _Zak Seidov_, Oct 29 2011