A twin Pythagorean triple is a Pythagorean triple of positive
integers for which two components are consecutive integers.
Every twin Pythagorean triple is a primitive
Pythagorean triple. Of the 16 primitive triples with hypotenuse less than 100,
seven are twin triples. The first few twin triples, sorted by increasing
, are (3, 4, 5), (5, 12, 13), (7, 24, 25), (20, 21, 29), (9,
40, 41), (11, 60, 61), (13, 84, 85), (15, 112, 113), ....
The numbers of twin triples with hypotenuse less than 10, ,
, ... are 1, 7, 24, 74, ... (OEIS A101903).
The first few leg-leg triplets are (3, 4, 5), (20, 21, 29), (119, 120, 169), (696, 697, 985), ... (OEIS A001652,
A046090, and A001653).
A closed form is available for the th such pair. Consider the general reduced solution
, then the requirement that the legs
be consecutive integers is
|
(1)
|
Rearranging gives
|
(2)
|
Setting
and
gives the Pell equation
|
(3)
|
Positive solutions of these Pell equations are given by
|
(4)
| |||
|
(5)
|
where
is a positive integer. The lengths of the legs
and
and the hypotenuse
are
|
(6)
| |||
|
(7)
| |||
|
(8)
| |||
|
(9)
| |||
|
(10)
| |||
|
(11)
| |||
|
(12)
| |||
|
(13)
| |||
|
(14)
|
Denoting the length of the shortest leg by then gives
|
(15)
| |||
|
(16)
|
(Beiler 1966, pp. 124-125 and 256-257). The hypotenuse formula can be inverted exactly as
|
(17)
|
The smaller exponential term in is positive and contributes less than 1, so
|
(18)
|
Taking natural logarithms also gives
|
(19)
|
For a positive integer , let
be the number of leg-leg twin triples with hypotenuse
at most
.
Since each
is an integer,
|
(20)
| |||
|
(21)
|
where
is the floor function. Consequently,
|
(22)
|
with leading coefficient approximately 0.5672963286.
The first few leg-hypotenuse triples are (3, 4, 5), (5, 12, 13), (7, 24, 25), (9, 40, 41), (11, 60, 61), (13,
84, 85), ... (OEIS A005408, A046092,
and A001844). Leg-hypotenuse twin triples occur whenever
|
(23)
|
|
(24)
|
that is to say when for a positive integer
,
in which case the hypotenuse exceeds the even leg by unity and the twin triplet is given by
. The number
of leg-hypotenuse
triplets with hypotenuse at most a positive
integer
is therefore given by
|
(25)
|
where
is the floor function. The first few values for
,
2, ... are 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, ... (OEIS A095861).
The numbers of leg-hypotenuse triples less than 10,
, ... are 1, 6, 21, 70, 223, 706, 2235, ... (OEIS A101904).
The total number of twin triples with hypotenuse
at most a positive integer
is
|
(26)
|
where the subtraction avoids double counting , the only triple whose two legs
and hypotenuse are consecutive integers.
Thus
|
(27)
|