OFFSET
1,1
COMMENTS
This sequence lists the larger prime in each consecutive prime pair where the difference is a local maximum in the sequence of prime gaps.
A local maximum occurs when p(n)-p(n-1) < p(n+1)-p(n) > p(n+2)-p(n+1) where p(n) is the n-th prime.
FORMULA
a(n) = prime(A198696(n)+1). - Michel Marcus, Jul 01 2025
EXAMPLE
The primes 7 and 11 differ by 4, which is larger than the previous gap (2) and the next gap (2). So 11 is in the sequence.
MATHEMATICA
Module[{primes = Prime[Range[1, 200]], diffs, res = {}}, diffs = Differences[primes];
Do[If[diffs[[i]] > diffs[[i - 1]] && diffs[[i]] > diffs[[i + 1]],
AppendTo[res, primes[[i + 1]]]], {i, 2, Length[diffs] - 1}]; res]
PROG
(Python)
from sympy import primerange
primes = list(primerange(2, 2000))
diffs = [primes[i+1] - primes[i] for i in range(len(primes)-1)]
local_max_asals = []
for i in range(1, len(diffs)-1):
if diffs[i] > diffs[i-1] and diffs[i] > diffs[i+1]:
local_max_asals.append(primes[i+1])
print(local_max_asals[:70])
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emirhan Üçok, Jun 29 2025
STATUS
approved
