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 A239879 #15 Aug 07 2025 15:03:09 %S A239879 3,5,7,11,13,17,19,29,31,41,43,53,59,61,71,73,97,101,103,107,109,137, %T A239879 139,149,151,157,173,179,181,191,193,197,199,211,223,227,229,239,241, %U A239879 257,263,269,271,281,283,311,313,347,349,373,397,401,419,421,431,433,457 %N A239879 Primes p such that either x divides y, or y divides x, where x = nextprime(p) - p, and y = p - prevprime(p). %C A239879 x and y are the distances from p to the nearest primes above and below p. %H A239879 Harvey P. Dale, <a href="/A239879/b239879.txt">Table of n, a(n) for n = 1..1000</a> %e A239879 The distances from p=29 to two nearest primes are 6 and 2, and, because 2 divides 6, p=29 is in the sequence. %t A239879 divQ[n_]:=Module[{pr=n-NextPrime[n,-1],nx=NextPrime[n]-n},Divisible[ pr,nx]||Divisible[nx,pr]]; Select[Prime[Range[2,100]],divQ] (* _Harvey P. Dale_, May 22 2014 *) %o A239879 (Python) %o A239879 import sympy %o A239879 prpr = 2 %o A239879 prev = 3 %o A239879 for i in range(5,1000,2): %o A239879 if sympy.isprime(i): %o A239879 x = i - prev %o A239879 y = prev - prpr %o A239879 if x%y==0 or y%x==0: print(prev, end=', ') %o A239879 prpr = prev %o A239879 prev = i %Y A239879 Cf. A000040, A239584. %K A239879 nonn %O A239879 1,1 %A A239879 _Alex Ratushnyak_, Mar 28 2014