## If ab+1, ac+1, and bc+1 are squares...

```Given any three positive integers a,b,c such that the product of
any two is one less than an integer squared, i.e.,

ab+1 = x^2       ac+1 = y^2       bc+1 = z^2

we seek a fourth positive integer d such that its product with any
of the first three is also one less than a square, i.e.,

ad+1 = w^2       bd+1 = u^2      cd+1 = v^2

This is an old and very interesting problem.  According to Dickson's
"History of the Theory of Numbers", the ancient Greek mathematician
Diophantus attacked the problem (in rational numbers) by taking  x,
x+2, 4x+4 as the first three numbers, and (3x+1)^2 - 1 as the product
of the first and fourth.  Thus the fourth is 9x+6.  The product of the
2nd and 4th increased by unity is 9x^2 + 24x + 13.  Setting this equal
to (3x-4)^2, he solved for x=1/16.

Fermat started with the three integers 1,3,8, and then the 4th number,
x, must make each of  x+1, 3x+1, 8x+1  square.  He solved this "triple
equation" for x=120.

Euler gave the parametric solution

a      b      c = a+b+2k      d = 4k(a+k)(b+k)

where k^2 = ab+1.  He then extended this to FIVE numbers, finding
that if we set
4r + 2u(1+s)
x =  ------------
(s-1)^2

where
u = a+b+c+d      r = abc+abd+acd+bcd       s = abcd

then each of the numbers 1+ax, 1+bx, 1+cx, 1+dx is a rational square.
He derived this from the fact that if each of these is a square, then
their product is also a square, i.e.,

y^2 = (1+ax)(1+bx)(1+cx)(1+dx)

=  1 + ux + vx^2 + rx^3 + sx^4

where v=(ab+ac+ad+bc+bd+cd).  (See Dickson, page 517 for the full
derivation.)  For example, this gives the five numbers

1      3      8     120      777480 / 2879^2

Another approach to this problem, suggested by Peter Montgomery based
on the solution of Arkin, Hoggatt, and Strauss, is to begin with the
familiar example a=1, b=3, c=8, d=120 and its permutations

ab+1 = 2^2      cd+1 = 31^2             (2)(31) = 62
ac+1 = 3^3      bd+1 = 19^2             (3)(19) = 57
bc+1 = 5^2      ad+1 = 11^2             (5)(11) = 55

and then observe that the products 62, 57, 55 are c+54, b+54, and
a+54.  Also, negating one of the square roots (say replacing 19 by
-19) we get 62, -57, 55, which are 63-a, 63-d, and 63-c.  This
suggests looking for a value of t such that

(b+t)^2 = (bd+1)(ac+1)
(c+t)^2 = (cd+1)(ab+1)

Subtract two equations (to eliminate the t^2 term) and solve for

d = a+b+c+2t

Plug this into any one of the three equations to get a quadratic
whose solution is

t = abc +- sqrt((ab+1)(ac+1)(bc+1))

Dan Cass applied Fermat's method to the triple a=6, b=8, c=28, which
means we want to make each of

6d+1     8d+1     28d+1

a square. Now 6d+1 is square exactly for d = 2p*(3p+-1), and 8d+1 is
square exactly for d = q*(2q+-1), and finally 28d+1 is square exactly
for d = r*(7r+-1).  So to find d we need "only" find p,q,r such that
the following "triple equation" holds:

2p(3p+-1)  =  q(2q+-1)  =  r(7r+-1)

with one of the 8 possible choices of +- sign.  Richard Pinch noted
that this triple equation reduces to the pair of simultenaeous
Pellians
4x^2 - 3y^2 = 1
7x^2 - 3z^2 = 4
where

x = 6p +- 1         y = 4q +- 1      z = 14r +- 1

Pinch also noted that Baker's method shows that any solution has
log(x) < 63.1.  Using a "seiving technique", it can then be shown
that the only solutions are x = 1, y = 1, z = 1.

Jim Buddenhagen noted a connection to elliptic curves:  If 6d+1,
8d+1, and 28d+1 are squares so is their product, so we have the
elliptic curve
y^2=(6d+1)(8d+1)(28d+1)

The point P=(0,1) is on the curve and can be used via the standard
chord/tangent method to get new points 2P, 3P, 4P, ...  , where now
d is rational.  This curve happens to be rank 1, and the point P is
a generator.  Furthermore, the points  P, 3P, 5P, 7P, ... each have
"d" coordinate making each of 6d+1, 8d+1, 28d+1 a rational square.
He then notes that 3P is an integer point with d-coordinate 5460.
With this value of d we get 6d+1=181^2, 8d+1=209^2, 28d+1=391^2.

In the general case,  y^2=(ad+1)(bd+1)(cd+1),  d and y variables.
The point P(0,1) is usually of infinite order (see Don Zagier's
survey paper on elliptic curves in Jbr. d. Dt. Math.-Verein vol
92(1990)58-76 for the exceptions).  The point 3P is now has

8(a-b-c)(a+b-c)(a-b+c)
d =    ---------------------------
(a^2+b^2+c^2-2ab-2ac-2bc)^2

which, if it is an integer (which is often the case) solves the
problem and in this case seems to coincide with Peter Montgomery's
solution.

Cass then asked:  Given that  ab+1=r^2, ac+1=s^2, bc+1=t^2 (all
integers), under what circumstances (conditions on a,b,c) is d
given by the above formula an integer?  And if it is an integer, is
it necessarily equal to a+b+c+2abc+2rst ?  (This was Montogmery's
solution, where the sign in front of 2rst could also be negative).

We observe that the great majority of triples (a,b,c) for which ab+1,
ac+1, and bc+1 are squares are evidently given by the two-parameter
family
a = n
b = q(qn+2)
c = (q+1)[(q+1)n + 2]

where n is an integer and q is any rational number such that b and c
are integers.  This solution was given by N. Saunderson in 1740.
(In nearly the only personal comment of the entire 3-volume History,
Dickson notes parenthetically that Saunderson was blind from infancy.)
For these triples we have

ab + 1  =  [ qn + 1 ]^2
ac + 1  =  [ (q+1)n + 1 ]^2
bc + 1  =  [ q(q+1)n + 2q + 1 ]^2

In general, for any triple a,b,c the two values of d given by
Montgomery's solution satisfy d+d' = 4abc+2(a+b+c).  However, for
Saunderson's family of triples we always have d'=0, so the only
non-trivial value of d is 4abc+2(a+b+c).  Substituting the values
of a,b,c gives
d = 4(nq+1)(nq+n+1)(nq^2+2q+nq+1)

so this is the 4th component of a Saunderson 4-tuple.

Of course, there are many "exceptional" triples a,b,c that are not
in Saunderson's family.  Here are some examples:

(1,3,120)       (2,4,420)      (3,5,1008)     (4,6,1980)
(1,3,1680)      (2,12,420)     (3,8,120)      (4,12,420)
(1,8,120)       (2,12,2380)    (3,8,2080)     (4,20,1980)
(1,8,528)       (2,24,2380)    (3,16,1008)     etc...

These triples have two non-zero d values, and are the triples for
which Buddenhagen's solution is not an integer.

In trying to find a simple parameterization of these "exceptional"
triples, we came across this simple 1-parameter family of solution
4-tuples

a = n - 1      b = n + 1      c = 4n      d = 4n(4n^2 - 1)

such that any product of 2 is one less than a square.  In general,
3-tuples such as a,b,d of this form do not satisfy the condition

so these are among the "exceptional" 3-tuples.  Buddenhagen then took
{a,b,d} of a Saunderson 4-tuple, which is an "exceptional" triple,
and determined the two possible "completions" from Montgomery's
solution.  Of course, one is just c from the original Saunderson
4-tuple, but the other is d', giving the family

a = n
b = m(mn+2)
c = 4(mn+1)(mn+n+1)(m(mn+n+2)+1)
d'= (2mn+1)(2mn+3)(m(2mn+2n+3)+1)(mn(2mn+2n+5)+3n+2)

for which the product of any two is 1 less than a square.

Phil Gibbs commented that Saunderson's parameterisation is equivalent
to the class of triples (a,b,c) which are the positive integer
solutions of the equation:

a^2 + b^2 + c^2 - 2ab - 2ac - 2bc = 4              (0)

and he pointed out a simple geometric construction of this class of
triplets (not surprising, considering the similarity of these formulas
with Heron's formula for the area of a triangle).  Suppose we have a
triangle in a plane whose vertices fall on lattice points with integer
values, and the area of that triangle is exactly one. Recall that the
area of a triangle with vertices (x1,y1), (x2,y2), and (x3,y3) is

(x1 y2 - x2 y1) + (x2 y3 - x3 y2) + (x3 y1 - x1 y3)
A  =  ---------------------------------------------------
2

Now let a, b, and c denote the products of the components of the three
edge vectors, i.e.,

a = (x2-x1)(y2-y1)    b = (x3-x1)(y3-y1)    c = (x3-x2)(y3-y2)

Then by simple algebra we find that

a^2 + b^2 + c^2 - 2ab - 2ac - 2bc  = (2A)^2

and therefore equation (0) is satisfied for a triangle of unit area.
As an example, consider the triangle XYZ where

X = (0,0)        Y = (2,4)        Z = (5,11)

and form the edge vectors

Y-X = (2,4)        Z-X = (5,11)       Z-Y = (3,7)

Multiplying together the coordinates of each vector, we get

8 = (2)(4)       55 = (5)(11)        21 = (3)(7)

which is a triplet.

But we know that equation (0) does not fully characterize solution triples,
because there exist solution triples that do not satisfy it. Notice that (0)
can also be written in the form

(a + b + c)^2 - 4(ab + ac + bc) = 4

More generally, I conjectured that the integers a,b,c constitute a solution
triple if and only if there exists an integer d such that

(a + b + c)^2 - 4(ab + ac + bc) = 4 - 2d(2abc+a+b+c) - d^2

With d = 0 this gives the non-exceptional triples, but EVERY triple satisfies
this equation for some integer d.  This is algebraically equivalent to the
relation

(2abc+a+b+c-d)^2 = 4(ab+1)(ac+1)(bc+1)

for some integer d, so the conjecture amounts to the assertion that a,b,c
is a solution triple if and only if the product (ab+1)(ac+1)(bc+1) is a
square. Phil Gibbs give a nice proof of this fact by a descent argument.
From the fact that the product is a square, we know there is an integer
d defined by
__________________
d = 2abc + a + b + c + 2 /(ab+1)(ac+1)(bc+1)

We can write the original relation in a more explicitly symmetrical form by
expanding each product and simplifying, leading to the "4-tuple equation"

a^2 + b^2 + c^2 + d^2 - 2(ab+bc+ac+ad+bd+cd) - 4abcd - 4 = 0

which can also be written in the form

(a+b-c-d)^2  =  4(ab+1)(cd+1)

(It's interesting to compare this with Cayley's generalized determinant for
2x2x2 matrices.) Notice that this is symmetrical under any permutation of
the four numbers a,b,c,d.  This equation can also be written explicitly as
a quadratic in any of the variables. For example, it can be written as

d^2 - 2(a+b+c+2abc)d + [a^2 + b^2 + c^2 - 4 - 2(ab+bc+ac)] = 0

This makes it clear that, for any given values of a,b,c, there are two
values of d that satisfy this quadratic.  We will call these two roots
d and d', and we note that d + d' = 2(a+b+c+2abc).

Now suppose we have a solution {a,b,c,d} of this equation in positive
integers, with the values arranged in non-decreasing order.  We can
generate 4 other solutions in integers by substituting the conjugate
root for any of the four variables. For example, we can replace d, which
we take to be the largest of the four integers, by

d' = 4abc + 2a + 2b + 2c - d

We know that d and d' are distinct, because

(d'-d)^2 = 16(ab+1)(bc+1)(ac+1)

which is not zero. It is possible, however, that d' might be negative,
but in that case the system would de-generate into one of just two
possible sets of numbers. We know d' satisfies

( a + b - c - d' )^2 = 4(ab+1)(cd'+1)

The left side is positive so the right side must also be positive,
and we know ab+1 is positive so cd' must be no less than -1, which
implies that either c = 0 or cd' = -1.  If cd' = -1 then d'=-1, c=1 and
a = b = 0.  On the other hand, if d' is not equal to -1, then c=0,
similarly a=b=0 then d' = -2.  Hence there are exactly two solutions in
integers for which a,b,c are non-negative and d is negative, namely
{0,0,0,-2} and {0,0,1,-1}.

Next we can show that when we replace d by d', d' is less than c

dd'   =   (c - a - b)^2 - 4(ab+1)    <    c^2

( given that c >= b >= a >= 0)  so d >= c => d' < c.

Now we have done enough to show that given a solution { a,b,c,d } we
can repeatedly substitude the greatest of the four numbers by its
other root giving a smaller solution each time until we get down to
one of the two solutions where one of the four numbers is negative,
i.e., {0,0,0,-2} or {0,0,1,-1}. These two solutions certainly have the
property that the product of any two is one less than a square.

To complete the proof we need to show that { a,b,c,d } has the
property that the product of any two is one less than a square
if the same is true for { a,b,c,d' }. This is easy to get from

( a + b - c - d )^2 = 4(ab+1)(cd+1)

and the similar equations with a,b,c permuted, which completes the
proof. (Incidentally, Kiran Kedlaya published an article in the Feb 98
issue of Mathematics Magazine, and the main result is this proposition.)

Gibbs conjectures that ALL 4-tuples are solutions of the "4-tuple"
equation, which can be written in any of the three equivalent forms

[(a+b)-(c+d)]^2 = 4(ab+1)(cd+1)

[(a+c)-(b+d)]^2 = 4(ac+1)(bd+1)

We also note that if we set A=sqrt(a), B=sqrt(b) and C=sqrt(c), then
the symmetrical expression for non-exceptional 3-tuples

a^2 + b^2 + c^2 - 2ab - 2ac - 2bc = 4

has the Heronian factorization

(A+B+C)(A+B-C)(A-B+C)(-A+B+C) = 4

and similarly the symmetrical expression for 4-tuples can be written
in either of the forms

-(A+B+C-D)(A+B-C+D)(A-B+C+D)(-A+B+C+D) = 4(1-ABCD)^2

(A+B-C-D)(A-B-C+D)(A+B-C-D)(A+B+C+D)  = 4(1+ABCD)^2

where D = sqrt(d). This relates to the area of a quadralateral, just
as the previous expression relates to the area of a triangle. In both
cases we have a product of four factors equal to a square.

We also observe that Saunderson triples {a,b,c} with a < b < c
we have
a = y - x          b = z - x          c = y + z

which follows from the general formula

y^2 - 1                 z^2 - 1
a  =  ---------         b  =  ----------
c                        c

Since ab = x^2 - 1 we have

(cx)^2  -  c^2  =  (yz+1)^2  -  (y+z)^2

so obviously we have a solution by setting cx = (yz+1) and c = (y+z).
Thus, for any rational values of y and z this construction gives a
rational solution triple (a,b,c) with x = (yz+1)/(y+z).  This is an
integer solution if and only if y and z are integers such that (y+z)
divides (yz+1).

Of course, we can also have solutions that don't require c = y+z.  For
the general rational solution we only require that c be rational for
any y and z such that ab+1 is a rational square.  Thus, ALL rational
solutions are given by the following 3-parameter family for any
rational values of y, z, and q:

a  =   (y^2 - 1)/c
b  =   (z^2 - 1 )/c
c  =   [ (y^2-1)(z^2-1) - q^2 ] / (2q)

These formulas were found by Euler.  From this it follows that, as noted
above, given any three integers {a,b,c}, the product of any two of them
is 1 less than a square if and only if the quantity

(abc)(abc+a+b+c) + (ab+ac+bc)                  (1)

is also 1 less than a square.  Again, we note that this is equivalent to
the statement that there is an integer m such that

(a+b+c)^2 - 4(ab+ac+bc) = 4 - m^2 + 2m(2abc+a+b+c)       (2)

With m=0 this gives the "non-exceptional" triples. In view of this, it's
interesting to review the conditions for sets of k integers such that
the product of any two is 1 less than a sqaure.  In the simplest case,
k=2, we seek pairs of integers {a,b} for which:

ab  =  n^2 - 1  =  (n-1)(n+1)                 (3)

The most obvious family of solutions is given by setting a=(n-1) and
b=(n+1) or, equivalently, |b-a| = 2.  Squaring this gives the condition

(a+b)^2  -  4(ab)  =  4                      (4)

so these might be called the "non-exceptional" doubles.  Of course,
this does not cover all doubles, because the quantity (n-1)(n+1) can
have other factorizations besides the algebraic one.

Proceding to triples {a,b,c}, we've seen that a large family of
triples (the "non-exceptional" ones) are given by

(a+b+c)^2  -  4(ab+ac+bc)  =  4                (5)

but again this does not cover all possible triples.

Going on to 4-tuples, we have Gibbs' interesting conjecture that

(a+b+c+d)^2  -  4(ab+ac+ad+bc+bd+cd)  -  4(abcd)  =  4

covers all possible 4-tuples. (Bear in mind that with d=0 this reduces
to (5), which is the equation for non-exceptional triples, so we can't
simply combine an exceptional triple with d=0 to give a 4-tuple that
violates this equation.)

On a related question, Gibbs asks if it's true that given any four
integers {a,b,c,d} the product of any two of them plus 1 is a square
if and only if the quantity

is a square?  Montgomery replied that the answer is no.  For example,
let a = b = c = d.  Or let a = 1,  c = b, d = b^2, with b arbitrary.
Here are some solutions (a, b, c, d, x) where a < b < c < d < 100
and x < 2^31 (x is the square root of the big product):

1         3        13        23       33600
1         5        11        19       40320
2        16        33        46    11035101
5        11        46        49    44324280

We may also consider a different generalization; given any four
integers {a,b,c,d}, is it true that the quantity

(abc+1)(abd+1)(acd+1)(bcd+1)

is a square iff (abc+1), (abd+1), (acd+1), and (bcd+1) are each
squares?  There are certainly 4-tuples of this kind.  Two examples
are {1,5,7,24} and {2,4,15,28}.

Notice that if this construction is extrapolated in reverse, it would
lead to the conjecture that (a+1)(b+1) is a square iff (a+1) and (b+1)
are each squares, which is obviously false.  So, in an effort to
devise a fully general proposition, we conjecture that, given any n
positive integers x1,x2,...,xn, the quantity

n  /  Q       \
PROD ( ----- + 1  )        where Q = (x1)(x2)...(xn)
i=1  \  xi      /

is a (n-1)th power iff each of the n factors  (Q/xi)+1 is a (n-1)th
power.  This is trivially true for n=2, and it certainly seems to be
true for n=3.

Incidentally, triples {a,b,c} such that

ab+1 = 2x^2          ac+1 = 2y^2          bc+1 = 2z^2

seem to be much more rare than the simple square triples.  The only
known example in integers greater than 1 is a=49, b=79, c=943.  It
is evidently possible for the product (ab+1)(ac+1)(bc+1) to be of
the form 2m^2 while the individual factors are not.
```