login
Odd primes p such that h(p) sets a record for closeness to the nearest integer, where h(p) is the altitude of a triangle with base p and other two sides the next two primes after p.
0

%I #5 Dec 17 2020 04:53:25

%S 3,5,7,11,249533,290531,350783,935201

%N Odd primes p such that h(p) sets a record for closeness to the nearest integer, where h(p) is the altitude of a triangle with base p and other two sides the next two primes after p.

%C If q and r are the next two primes after p, h(p) = sqrt(2*(p^2*q^2+p^2*r^2+q^2*r^2)-p^4-q^4-r^4)/(2*p).

%e The first three odd primes are 3, 5, 7, 11, with h(3) ~= 4.330127020,

%e h(5) ~= 5.187484941 (closer to 5 than h(3) is to 4), h(7) ~= 10.99976809 (closer to 11 than h(5) is to 5), h(11) ~= 12.99992053 (closer to 13 than h(7) is to 11). Thus a(1) to a(4) are 3, 5, 7, 11. After that the values are all farther from their nearest integers than h(11) is to 13 until 249533: h(249533) ~= 216109.99994158 is closer to 216110 than is h(11) to 13.

%p H:= (p,q,r) -> sqrt(2*(p^2*q^2+p^2*r^2+q^2*r^2)-p^4-q^4-r^4)/(2*p):

%p q:= 3: r:= 5: bestw:= 1: R:= NULL:

%p while r < 10^6 do

%p p:= q; q:= r; r:= nextprime(r);

%p v:= H(p,q,r);

%p w:= frac(v); w:= min(w, 1-w);

%p if is(w < bestw) then

%p bestw:= w;

%p R:= R, p;

%p fi;

%p od:

%p R;

%K nonn,more

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Dec 16 2020