Find all positive integers x such that x, x, x-13 are sides of a triangle with integer area?

Two such integers are 37 and 85. Use any tools: computer programs, pencils and paper, whatever. Acceptable answers would include a recursive or explicitly defined sequence giving all such x, explicit formulas, or proof that there are only finitely many solutions (preferably with a list of what they are). As of this writing I do not know the answer, but I feel that I could probably work it out with some effort.

2010-07-31T05:59:10Z

Interesting and nice work by everyone so far. Keep going!

In case it helps, I have now computed the following terms of this sequence:

5, 13, 37, 85, 221, 565, 1237, 3133, 7925, 17285, 43693, 110437, 240805, 608621, 1538245, 3354037

The first two terms don't correspond to real triangles.

2010-07-31T06:03:43Z

Note: the above sequence was computed directly, not by using gianlino's fine analysis and recursions.

Duke2010-08-04T05:43:22Z

Favorite Answer

A remarkable fact is that many problems about integer triangles lead to Pell's Equation and its generalizations and this one is not an exception. The theory of Pell's Equation and Pell-like Equation allows full analysis of the problem, including explicit expressions for its solutions.

As Passionately Curious has noted above, we can conclude, using the Heron's Formula, that
(3x - 13)(x + 13) must be a perfect square with x odd. Let 3x² + 26x - 13² = y², then
9x² + 2*3*13x + 13² - 4*13² = 3y² or (3x + 13)² - 3y² = 26²,
or denoting ξ = 3x + 13, η = y we arrive to

(1) ξ² - 3η² = 26² , what is a Pell-like equation we must solve.

According the general theory the Pell's equation:
(2) u² - dv² = 1 /d > 0, square-free integer/
has infinitely many solutions. If (u, v) is any of them and if the Pell-like equation
(3) ξ² - dη² = c /same d as above and integer c/
has a particular solution (ξ₀, η₀), then
(4) ξ = ξ₀u + dη₀v, η = η₀u + ξ₀v
is also solution of (3) and all solutions of (3) can be obtained by formulas(4), taking certain finite number of fundamental solutions (how many exactly depends on c and d) of (3) and 'breeding' them with all solutions of (2). This way if (3) has a solution at all, it has infinitely many.

Solution of u² - 3v² = 1 (follow the link below for details)
http://en.wikipedia.org/wiki/Pell%27s_equation#Solutions
A fundamental solution is (2, 1), hence all solutions are obtained by

(5) u_{n} = ((2 + √3)ⁿ + (2 - √3)ⁿ)/2; v_{n} = ((2 + √3)ⁿ - (2 - √3)ⁿ)/(2√3), n = 0, 1, 2, . .

or by recursive expressions (see the article)
(6) u_{n+1} = 2u_{n} + 3v_{n}; v_{n+1} = u_{n} + 2v_{n}, u₀ = 1, v₀ = 0;
Here are some values:
n || 0 | 1 | 2 | 3 | 4 | 5
- - - - - - - - - - - - - - - - - - -
u || 1 | 2 | 7 | 26 | 97 | 362
v || 0 | 1 | 4 | 15 | 56 | 209
By the way the 1st expression of (6) implies u ≡ 1 (mod 3) if n is even, u ≡ 2 (mod 3) if n is odd.

Solution of (1): the 3 least fundamental solutions we need are (26, 0), (28, 6) and (124, 70), so according (4) we'll have:
(7) ξ = 26u, η = 26v;
(8) ξ = 28u + 18v, η = 6u + 28v;
(9) ξ = 124u + 210v, η = 70u + 124v; /u, v in (7) - (9) according (5) above/

Finally we must provide x = (ξ - 13)/3 to be odd integer, i.e. ξ ≡ 1 (mod 3) and (7) - (9) yield the following explicit expressions:

(10) x = (26u - 13)/3; u according (5) with n - odd;
n = 1, 3, 5 etc. yield x = 13, 221, 3133, etc.

(11) x = (28u + 18v - 13)/3; u, v according (5) with n - even;
n = 2, 4, etc. yield x = 5, 85, etc.

(12) x = (124u + 210v - 13)/3; u, v according (5) with n - even;
n = 2, 4, etc. yield x = 37, 565, etc.
Numerators in the above expressions show that x is odd as required (ξ is even).

As can be seen, (11) yields 1st, 4th, 7th, 10th, etc. solution in the list, mentioned in the Additional Details, (10) yields 2nd, 5th, 8th, etc., (12) yields 3rd, 6th, 9th, etc.

Passionately Curious2010-07-30T23:40:39Z

Let s = (3x - 13)/2

Then by Heron's Formula, the area is
√(s(s - x)(s - x)(s - x + 13))
= (s - x) √(s(s - x + 13))

For this to be an integer, √(s(s - x + 13)) must be rational, and since it is the square-root of an integer,
s(s - x + 13) must be a square.

So (3x - 13)/2 ((3x - 13)/2 - x + 13)
= (3x - 13)(3x - 13 - 2x + 26) / 4
= (3x - 13)(x + 13) / 4 must be a square.

Then (3x - 13)(x + 13) must be an even square.
Suppose p divides both 3x - 13 and x + 13.
Then p divides 3(x + 13) - (3x - 13) = 52
=> p = 1, 2, 4, 13, 26, 52

So we must consider the following cases:
3x - 13 = a², x + 13 = b²
3x - 13 = 2a², x + 13 = 2b²
3x - 13 = 13a², x + 13 = 13b²
3x - 13 = 26a², x + 13 = 26b²

Case 1: 3x - 13 = a², x + 13 = b²

If x is even then both a and b must be odd.
Then 4x = a² + b² ≡ 2 (mod 8) since a and b are odd.
But 4x ≡ 0 (mod 8) since x is even, a contradiction.

So x is odd.
Then a and b are both even. So let a = 2k, b = 2m
Then 3b² - a² = 52
=> 12m² - 4a² = 52
=> 3m² - a² = 13
=> -a² ≡ 1 (mod 3)
=> a² ≡ 2 (mod 3), a contradiction. So there are no solutions in this case.

Case 3:
3x - 13 = 13a², x + 13 = 13b²
Then 39b² - 13a² = 52
=> 3b² - a² = 4
=> -a² ≡ 1 (mod 3)
=> a² ≡ 2 (mod 3), a contradiction.

This leaves case 2 and 4.

Case 2:
3x - 13 = 2a², x + 13 = 2b²
Then 6b² - 2a² = 52
=> 3b² - a² = 26

Any solution (a, b) to this Pell-Like equation produces a solution for x, and there are infinitely many since
(a, b) = (1, 3) is a solution.
Then it is just a matter of determining when x will be greater than 13.

(Any solution will produce a solution, since we can take x = 2b² - 13
Then 3x - 13 = 6b² - 39 - 13 = 52 + 2a² - 52 = 2a² and
x + 13 = 2b²)

Also, x > 13 <=> x + 13 > 26
<=> 2b² > 26
<=> b² > 13
<=> |b| > √13

Case 4:
3x - 13 = 26a², x + 13 = 26b²
Then 78b² - 26a² = 52
=> 3b² - a² = 2

Once again, any solution (a, b) to this Pell-Like equation will produce a solution for x, and there are infinitely many since (a, b) = (1, 1) is a solution.
Again, it is just a matter of determining when x > 13.

x > 13
<=> x + 13 > 26
<=> 26b² > 26
<=> b² > 1
<=> |b| > 1

I'll solve the equations later.

==========================
edit:
Simplifying the above a bit
If 3x - 13 = ka² and x + 13 = kb² then
3kb² - ka² = 52
=> -ka² ≡ 1 (mod 3)
And then k ≡ 2 (mod 3)
Which means we only have to check the cases
k = 2 and k = 26 as before, but with significantly less work to get to that point :)

gianlino2010-07-30T23:23:12Z

The next solution is 221.

There is also 565...

@PC 5. You don't seem worried that your program misses 221.
Also the gap between 1237 and 7925 certainly misses one solution too. The problem may be that in your parametrization of Pythagorean triplets you could also have N = a^2 - b^2 and x -13 = 2ab. So I guess your program will miss about half the solutions, until you fix it.

edit So thx to the list of PC5, here is some further clarification.
The solutions missing in his list seem to be the ones which are also multiple of 13, since 13*17 = 221, and obviously x = 13 is a solution, although geometrically degenerate. The pattern of solutions multiple of 13 is simple. one reduces to the equation 3 p^2 - 2 = q^2. The solutions in p are given by

1,3,11,41 and follow the recursive formula
p_(n+1) = 4*p_n - p_(n-1).

once you have p and q, you have a solution by setting x = (2p^2 - 1)*13.

p = 1 gives 13, degenerate triangle

p = 3 gives 13*17 = 221

p = 11 gives 13*241 = 3133

p = 41 gives 13*3361= 43693

The sequence 17, 241, 3361, 46817 follows the induction

y_(n+1) = 14*y_n - y_(n-1) + 4.

Most likely the solutions which are not multiple of 13 will belong to 2 sequences following the same pattern

z_(n+1) = 14*z_n - z_(n-1) + C where C has to be adjusted from known values.

One sequence will be 37, 565, 7925 and so on....

The other 85, 1237, 17285,....

These values are enough to compute C.

52 for the first one. and ... same for the second.

To check this let's just look at "non geometric" solutions. For the first sequence

z_0 + z_2 = 14 z_1 + 52, that is z_0 + 565 = 14*37 + 52 = 570. So z_0 = 5 and z_0 - 13 = - 8. This is the triangle 5,5,8 in disguise, corresponding to (x,,x,13-x) having integer area.

For the second sequence

z_0 + z_2 = 14 z_1 + 52, that is z_0 + 1237 = 14 * 85 + 52 = 1242, so we get the same initial condition.

Notice that the multiples of 13 also satisfy

z_(n+1) = 14*z_n - z_(n-1) + 52.

So we just have the complete set of solutions. 3 sequences having the same recursive formula but different initial values..

As of this writing I do not have a proof, "but I feel that I could probably work it out with some effort."

Thx JB for this last line, it's a shame I had to adapt it =).

Edit You can observe that if you continue the non multiple sequences backwards you just exchange them. In other words the sequence

......., 17285, 1237, 85, 5, 37, 565, 7925,...

indexed over Z, satisfies to

z_(n+1) + z_(n-1) = 14*z_n + 52

and gives all solutions not multiple of 13.

By contrast the multiple sequence reproduces itself so that

.......,43693, 3133, 221,13, 13, 221, 3133, 43693,............

also satisfies z_(n+1) + z_(n-1) = 14*z_n + 52.

Edit If you consider the sequence 0, 1, 5, 20, 76 and more generally z_(n+1) = 4*z_n - z_(n-1) + 1. let T_n be the triangular number of order z_n. You then get
0, 1, 15, 210, 2926... Now

(16 T_n + 1)*13 gives you the list of solutions multiple of 13...

Would be nice to know why...

edit Triangular numbers also show up in the other sequence. All numbers are of the form 16a + 5 where a goes through the sequence

....., 1080, 77, 5, 0, 2, 35, 495, .........

Add 1 and you get triangular numbers of indices

....46, 12, 3, 1, 2, 8, 31

This is a sequence indexed by Z such that

z_(n+1) = 4*z_n - z_(n-1) + 1.

If T_n is the triangular number of order z_n, then

16 (T_n - 1 ) + 5 = 16 T_n - 11 is a solution.

Edit: Let's look at the heights of the solutions multiple of 13. After factoring out 13, we get the numbers such that (n,h,2n+1) is a Pythagorean triplet..

We get (0,1,1),(8,15,17),(120,209,241),(1680,2911,3361).....

The sequence of heights

1, 15, 209, 2911, etc can be embedded into the sequence

1, 4, 15, 56, 209, 780, 2911,10864, 40545

which satisfies x_(n+1) = 4 x_n - x_(n-1).

Since there is no constant in this sequence, it's tempting to look at heights in the irreducible case.

We want Pythagorean triplets of the form (n,h,2n + 13) and we got
(612,1075,1237),(36,77,85),
(-4,3,5),
(12,35,37),(276,493,565)

So let's try to embed 1075, 77, 3, 35, 493.

Since 493 + 35 = 528 = 4 * 132, we can squeeze 132 between 493 and 35. Now 35*4 = 140 = 132 + 8. So we have 8 between 35 and 3. Note that 4 * 8 = - 3 + 35. So we should look for negative numbers on the left side. Indeed the sequence

........., -1075, -288, -77,-20, -3, 8, 35, 132, 493, 1840,.............

satisfies x_(n+1) = 4 x_n - x_(n-1).

Given the similarity of what we got for 13 and 1
one should get the same thing if 13 is replaced by other prime numbers, but that may depend on the class mod 4.

Edit: One can wonder what the complementary sequences

4, 56, 780,10864, in the case (x,x,x-1)
and
-288,-20, 8, 132, 1840,..... in the case (x,x,x-13)
represent.
They are the heights corresponding to the (x,x,x+1) and (x,x,x+13) problems.

4 is the height of (5,5,6), 56 is the height of (65,65,66) and so on. for (x,x,x+1)

8 is the height of (17,17,30), 132 of (157,157,170) while
20 is the height of (29,29,42) and 288 of (337,337,350) for (x,x,x+13).

pc-52010-07-31T02:39:18Z

The area of such a triangle is (1/4)(x-13)sqrt(4x^2 - (x-13)^2), which is an integer only
when x is an odd integer.

Let 4x^2 - (x-13)^2 = N^2, so that the area turns out to be an integer.
Then 4x^2 = N^2 + (x-13)^2.

This is an equation similar to the Pythagorean Theorem, so let
2x = a^2 + b^2
x - 13 = a^2 - b^2
N = 2ab

Then 2x = a^2 + b^2 = 2a^2 - 2b^2 + 26
a^2 = 3b^2 - 26
x = 2b^2 - 13
Note that x can only be odd, which is what is sought.
The triangular area in terms of a and b is then ab(b^2 -13),
where a, b are both integers that satisfy the equation
a^2 = 3b^2 - 26, and x = 2b^2 - 13.

A simple computer program I wrote produced the following result:
x = 37, 85, 565, 1237, 7925, 17285, ...

@ gianlino, there is no dispute. You are a fine mathematician beyond ordinary.

Dragan K2010-07-31T16:22:06Z

I noticed interesting recursive relation.
If we take:

a[1] = 5
a[2] = 13
a[3] = 37
a[4] = 85
a[5] = 221
a[6] = 565
a[7] = 1237

Then with:
a[n] = a[n-1] + 14*a[n-3] - 14*a[n-4] - a[n-6] + a[n-7]
we can generate all solutions.

And also very interesting to me is that, when I changed question in triangle with x, x, x-11 sides, again THE SAME relation occur, only with different initial conditions!

Question is, can we generate all solution for any x, x, x-m triangle, by recurrence:

a[n] = a[n-1] + 14*a[n-3] - 14*a[n-4] - a[n-6] + a[n-7]

?
*********************
EDIT:
Ah, we can't, I just try for x, x, x-7 triangle.

:)