OFFSET
1,1
COMMENTS
x and y are the distances from p to the nearest primes above and below p.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The distances from p=29 to two nearest primes are 6 and 2, and, because 2 divides 6, p=29 is in the sequence.
MATHEMATICA
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 *)
PROG
(Python)
import sympy
prpr = 2
prev = 3
for i in range(5, 1000, 2):
if sympy.isprime(i):
x = i - prev
y = prev - prpr
if x%y==0 or y%x==0: print str(prev)+', ',
prpr = prev
prev = i
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Mar 28 2014
STATUS
approved