Sebastián Martín Ruiz sends the following conjecture from his own
invention:

Let p, q be consecutive prime numbers, p<q.

Let z=sqrt[(p^{2}+q^{2})/2-1]

Conjecture: p&q are
prime twins iff z is integer.

Question: Prove it or show it false.

Contributions came from Farideh
Firoozbakht, Danielle G. Degiorgi, Mike Oakes & Robin García.

***

Farideh wrote:

The following statement,

((p(n+1)^2 + p(n)^2)/2-1))^(1/2) is
integer iff p(n+1) - p(n ) = 2 (**)

is a result of conjecture 30 and it can be mentioned
as a conjecture.

Proof : Let f(n) = ((p(n+1)^2 + p(n)^2)/2 -
1))^(1/2) and d(n) = p(n+1) - p(n)

so f(n) = ((p(n)+d(n)/2)^2 + d(n)^2/4 - 1)^(1/2)
(I).

If d(n) = 2 then as SMR pointed out ( by using (I) )
we get that f(n) = p(n)+1

so f(n) is an integer. Now suppose that f(n) is an
integer, then we have the following two cases:

1. d(n) ^2/4 - 1 = 0 , namely d(n) = 2 & f(n) = p(n)
+1.

2. d(n) ^2/4 - 1 > 0 or d(n) > 2.

By using the relation (*): d(n) < 2(log p(n))^2

which is one of the results of conjecture 30, we show
that the second case

is impossible.

If d(n) ^2/4 - 1 > 0 (d(n) > 2) then f(n) >= (p(n)+d(n)/2)
+ 1,

hence,

p(n) + 3/2 <= (1/8)*(d(n) -
2)^2

but by using (*) we conclude that,

p(n) + 3/2 < (1/8)*(2(log
p(n))^2 - 2)^2

or,

p(n) + 3/2 < (1/2)*(log p(n))^2
- 1)^2.

But we can easily show that if p is a number greater
than 1229 then

p + 3/2 > (1/2)*(log p)^2 - 1)^2 which contradicts
the last inequality

and for n < pi(1229) = 201 we can directly check that
if f(n) is an integer then

d(n) = 2. Hence using (*) we can deduce the statement
(**).

***

Danielle sent his contribution in
this .pdf file. In the email he added
the following comments:

I
include a pdf (and the related latex file) with some notes on
conjecture where it is shown, that two consecutive primes giving an
integer z need to have difference 2 or a difference not smaller than
2sqrt(2p+3)+2.

As
the Riemann Hypothesis implies that the gap between two consecutive
primes is smaller than p^(1/2+eps), the conjecture probably also
follows from it.

When
the Riemann Hypothesis is not true, we still known that the gap is
smaller than p^0.525, and thus is very unlikely (but not necessarily
impossible) to find a counterexample, in any case very large.

There are other conjectures implying this: from [2,A8], Dorin
Andrica conjecture imply q-p<sqrt(q)+sqrt(p), and as Bertrand
Postulate shows that q-p<2p, it would follow q-p<2sqrt( 2p).

***

Mike wrote:

The "only if" is trivial:

If p and q are twin primes, then q = p+2, so z = (p+1).

As for the "if":

The conjecture is true for p = 2, so assume p >= 3.

If we write

q = p+2*d,

then

z^2 = (p+d)^2 + (d^2-1).

Now,

(p+d+1)^2 is the next perfect square after (p+d)^2.

So if

(p+d)^2 + (d^2-1) < (p+d+1)^2 ... (*)

then z^2 is /not/ a perfect square.

The condition (*) is:

(d^2-1) < (p+d+1)^2 - (p+d)^2

or

d^2-1 < 2*p+2*d+1

or

(d-1)^2 < 2*p+3

or

d < (sqrt(2*p+3) + 1)

or

q < p + 2*(sqrt(2*p+3)+1)

In words: the gap between the prime p and the next prime q
should not exceed 2*(sqrt(2*p+3)+1).

This is easily verified to hold for all primes p <= 10^9.

It is believed that the gap between successive primes (p, q)
is bounded by sqrt(p) for all p, but this has never been
proved.

Conclusion: The Conjecture is almost certainly true, but is
equivalent to another conjecture which is very deep and
unlikely to be proved any time soon.

***

Robin wrote:

Mensaje:

If p and q are consecutive odd prime, q=p+g and g is even->q=p+2t

z=sqrt((p^2+(p+2t)^2)/2-1)=sqrt(p^2+2pt+2t^2-1)

If t=1, then p and q are twin primes and z=p+1 is an integer.

If t>1 and z is an integer, then 2t^2-1>t^2 and z>p+t. So z=p+t+n.

And z^2=(p+t+n)^2=p^2+2pt+2t^2-1-->

p=((t-n)^2-(2n^2+1))/2n, q=p+2t, z=p+t+n

IF n=1

p=((t-1)^2-3)/2

We check t values such that p and q=p+2t are primes, and the number of
primes between p and q:

t=4 p=3 q=11 z=8 2 primes

t=6 p=11 q=23 z=18 3 primes

t=12 p=59 q=83 z=72 5 primes

t=24 p=263 q=311 z=288 7 primes

t=30 p=419 q=479 z=450 10 primes

t=66 p=2111 q=2243 z=2178 15 primes

t=78 p=2963 q=3119 z=3042 16 primes

t=102 p=5099 q=5303 z=5202 21 primes

IF n=2

p=((t-2)^2-9)/4=((t+1)/2)((t-5)/2)is always composite.

IF n=3

P=((t-3)^2-19)/6

t=28 p=101 q=157 z=132 10 primes

t=62 p=577 q=701 z=642 19 primes

IF n=4

p=((t-4)^2-33)/8

t=15 p=11 q=41 z=30 7 primes

t=33 p=101 q=167 z=138 12 primes

t=39 p=149 q=227 z=192 13 primes

t=57 p=347 q=461 z=408 19 primes

t=63 p=431 q=557 z=498 18 primes

t=87 p=857 q=1031 z=948 24 primes

IF n=5

p=((t-5)^2-51)/10

t=14 p=3 q=31 z=22 8 primes

t=24 p=31 q=79 z=60 10 primes

t=66 p=367 q=499 z=438 21 primes

t=84 p=619 q=787 z=708 23 primes

And so on...When n increases, q-p=f(p) increases.

We clearly see that if t>1 and z is an integer, then p and q are not
consecutive primes, because q-p is always of the order of sqrt(p) which
is much more than the average gap between consecutive primes: ln(p)

And so the conjecture is VERY PROBABLY true.

To prove it would be much harder.

***

Thomas R. Nicely wrote (July 06):

I restate the conjecture as follows.

CONJECTURE: Suppose p and q are consecutive primes, p < q. Define

J = (p*p + q*q)/2 - 1. Then J is a perfect square if and only if

p and q constitute a twin-prime pair.

Proof of the _if_ part is straightforward. For then q=p+2 and

2J = p*p + (p+2)*(p+2) - 2 = 2*p*p + 4*p + 4 - 2, so

J = p*p + 2*p + 1, thus J is the square of (p+1).

I have been unable to prove the _only if_ part. I have verified

it numerically for all consecutive primes < 2^32=4294967296. If

the primes are not consecutive, the assertion is no longer true,

as is shown shown by the counterexamples (p=3, q=11) and

(p=67, q=479), among others.

A sufficient condition for the proof of the _only if_ part appears

to be d < 2*sqrt(p) + 1, where d=q-p=2r (d > r > 0) is the

difference (gap) between consecutive primes and r is half the

difference (we can assume p and q odd, since the conjecture is

obviously true for p=2 and q=3). The logic is as follows:

Suppose d < 2*sqrt(p) + 1 ; (**)

===> (d - 1)^2 < 4p

===> 4p > (d - 1)^2

===> 4p > (d - 1)^2 - 6

===> 4p > (2r - 1)^2 - 6

===> 4p > 4r^2 - 4r - 5

===> 4r^2 < 5 + 4p + 4r

===> 4r^2 - 4 < 1 + 4p + 4r

===> r^2 - 1 < 1/4 + p + r

===> (p + r)^2 + r^2 - 1 < (p + r)^2 + 1/4 + (p + r)

===> (p + r)^2 + (r^2 - 1) < (p + r + 1/2)^2

===> (p + r) <= sqrt((p+r)^2 + (r^2 - 1) < (p + r + 1/2)

The LHS of the last inequality is true because r >= 1;

equality holds if and only if r=1. Thus the nearest integer

to the sqrt must be p+r, so that (p+r)^2 + (r^2 - 1) is a

perfect square if and only if r=1 (in which case d=2 and p

and q are twin primes). Now note that

J = (p^2 + (p+2r)^2)/2 - 1 = (2p^2 + 4pr + 4r^2)/2 - 1

= p^2 + 2pr + 2r^2 - 1 = (p^2 + 2pr + r^2) + (r^2 - 1)

= (p + r)^2 + (r^2 - 1)

Thus J is a perfect square if and only if r=1, d=2, and p and

q are twin primes---IF condition (**) above is met, that is,

d < 2*sqrt(p) + 1 for all consecutive primes p and q. This

amounts to the assumption that the difference between consecutive

primes remains "small" in a sense, or that prime gaps remain

"small" compared to the bounding primes. The "smallness"

requirement is the reason the conjecture fails for some

non-consecutive primes such as (p=3,q=11) or (p=67,q=479).

Condition (**) is known to be true for all consecutive primes

which have been directly calculated---at the moment, for all

p < 4.1*10^17. In fact, for large values of p, d is much

less than sqrt(p); the largest d below 4.1*10^17 is only 1356,

for p=401429925999153707 (Knuth, 2006). Indeed, there exist

much stronger conjectures regarding the asymptotic behavior

of d. Piltz (1884) conjectured that d=O(p^e) for any fixed e > 0;

Cramér (1936-37) conjectured d=O((ln(p))^2). However, as of 1995,

the best _proven_ result was that d=O(p^0.535...) (Baker and

Harman, 1995), and even assuming the Riemann Hypothesis, the

best result proven is d=O(sqrt(p)*ln(p)) (Cramér, 1936-37). Thus

condition (**) remains, for the moment, a conjecture, and

therefore so does the _only if_ part of your own conjecture.

However, (**) is now known to be true for p < 4.1*10^17, and

thus the _only if_ statement is also known to be true throughout

that range.

Of course, it may be possible to prove the _only if_ portion

by some other line of reasoning which is not apparent to me.

.. a document an important source of

information regarding the asymptotic behavior of d, the

difference between consecutive primes; namely, "The new book

of prime number records," Paulo Ribenboim (3rd edition, 1996,

Springer-Verlag, New York), pp. 250-265. A more recent edition

exists, but I do not have access to it. Also, the information

on the state of the search for prime gaps is posted at

<http://www.trnicely.net/gaps/gaplist.html>.

***