%I #25 Mar 23 2024 21:13:35
%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 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