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 #28 Nov 28 2024 10:53:17
%S 3,7,7,7,47,251,421,421,9769,9769,36469,36469,36469,184224493,
%T 2159263321,13848073963,33980350373
%N a(n) is the largest prime p such that all prime numbers q <= p have distinct length n prime gap sequences.
%C Given p(i) the i-th prime number, the gap sequence of length n for prime p(i) is defined as: p(i+1)-p(i), p(i+2)-p(i+1), ..., p(i+n)-p(i+n-1). E.g., the length 3 gap sequence of 7 is [11-7, 13-11, 17-13] is [4, 2, 4].
%e For n = 5, the largest prime with a distinct gap sequence is 47. For all primes up to and including 47, the length 5 gap sequences are distinct, while the next prime, 53, has a gap sequence equal to 23, namely [6, 2, 6, 4, 2].
%o (Python)
%o # Program doesn't compile. _Robert C. Lyons_, Nov 24 2024
%o s = set()
%o for p, g in ((w[0][0], tuple(r - q for q, r in w[1:])) for w in sliding_window(pairwise(primes()), n + 1)):
%o if g in s: return p
%o else: s.add(g)
%Y Cf. A001223.
%K nonn,more
%O 1,1
%A _Leo Vandriel_, Feb 21 2024