This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A373299 #25 Jun 30 2024 22:00:32 %S A373299 7,11,13,17,29,41,59,79,101,103,107,113,139,163,181,193,227,257,269, %T A373299 311,359,379,397,419,421,439,461,487,491,547,569,577,599,691,701,709, %U A373299 761,811,823,857,863,881,887,919,983,1021,1049,1051,1091,1109,1163 %N A373299 Numbers prime(k) such that prime(k) - prime(k-1) = prime(k+2) - prime(k+1). %H A373299 Robert Israel, <a href="/A373299/b373299.txt">Table of n, a(n) for n = 1..10000</a> %F A373299 a(n) = A151800(A022885(n)). %e A373299 7 is in the list because the prime previous to 7 is 5 and the next primes after 7 are 11 and 13, so we have 7 - 5 = 13 - 11 = 2. %p A373299 P:= select(isprime,[seq(i,i=3..10^4,2)]): %p A373299 G:= P[2..-1]-P[1..-2]: nG:= nops(G): %p A373299 J:= select(t -> G[t-1]=G[t+1],[$2..nG-1]): %p A373299 P[J]; # _Robert Israel_, May 31 2024 %t A373299 Select[Partition[Prime[Range[200]], 4, 1], #[[2]] - #[[1]] == #[[4]] - #[[3]] &][[;; , 2]] (* _Amiram Eldar_, May 31 2024 *) %o A373299 (Python) %o A373299 from sympy import prime %o A373299 def ok(k): %o A373299 return prime(k)-prime(k-1) == prime(k+2)-prime(k+1) %o A373299 print([prime(k) for k in range(2,200) if ok(k)]) %o A373299 (Python) %o A373299 from sympy import nextprime %o A373299 from itertools import islice %o A373299 def agen(): # generator of terms %o A373299 p, q, r, s = [2, 3, 5, 7] %o A373299 while True: %o A373299 if q-p == s-r: yield q %o A373299 p, q, r, s = q, r, s, nextprime(s) %o A373299 print(list(islice(agen(), 60))) # _Michael S. Branicky_, May 31 2024 %Y A373299 Cf. A001223, A022885, A151800, A263674. %K A373299 nonn %O A373299 1,1 %A A373299 _Alexandre Herrera_, May 31 2024