login
a(n) = r-th prime of the form (p-q)/(q-r) with r=prime(n+1), q=prime(n+2), and primes p > q.
1

%I #9 Jan 08 2021 20:17:19

%S 13,17,47,107,179,311,401,199,761,367,1229,1049,1499,701,739,1979,

%T 1069,2543,2399,1447,3209,1619,4889,4583,4373,4703,4451,5351,5669,

%U 6329,2749,6491,5309,7433,4159,3613,8693,4001,3823,9311,7757,10343,11789,10559,5231,6323,14033,12539,14627,6163,13619,12107,7477,7621,7433,15461,7451,17957,16073,14057,18743,20543,19763,22679,20543,10289

%N a(n) = r-th prime of the form (p-q)/(q-r) with r=prime(n+1), q=prime(n+2), and primes p > q.

%C Original definition: First occurrence of the first k-th occurrence where (p-q)/(q-k), p,q,k are primes.

%C From the original definition and program (which gives different results depending on the upper limit n) it is not obvious, but for any odd prime r, a solution will always be found for q=nextprime(r+1), by considering the r-th prime of the form p=q+(q-r)*prime(i), i=1,2,3... - _M. F. Hasler_, Apr 05 2009

%e For the first odd prime r=3 and its successor prime q=5, (p-q)/(q-r) is prime for p=11, 19, 31, ... and the (r=3)-rd ratio is (31-5)/(5-3)=13=a(1). - _M. F. Hasler_, Apr 05 2009

%o (PARI) diff2sqp2(n,r,d) = { forprime(q=d+1,n, c=0; forprime(p=q+1,n, y=(p-q)/(q-d); if(y==floor(y), if(isprime(y),c++; if(c==r, print1(y",");break)) ) ) ) } diff2sqp3(n) = { forprime(k=3,n, diff2sqp2(n,k,k); print(); ) }

%o (PARI) A089577(n) = { local( q=prime(n+2), r=prime(n+1), d=q-r, y=1); until( isprime( q+d*y=nextprime(y+1)) & ! r--,) ;y} \\ _M. F. Hasler_, Apr 05 2009

%K easy,nonn

%O 1,1

%A _Cino Hilliard_, Dec 29 2003

%E Corrected, extended and edited by _M. F. Hasler_, Apr 05 2009