Bob, you are correct, there is no known algorithm guaranteed to compute the rank of an elliptic curve. There are however very effective algorithms for obtaining an upper bound on the rank by computing a Selmer group.

This can be done in either Sage or Magma. Since Sage is free, I will put some sample code here:

```
sage: k = 6/17
sage: E = EllipticCurve([0,-1 - k^2, 0, k^2, 0]).minimal_model()
sage: E.selmer_rank() - E.two_torsion_rank() # Upper bound from 2-Selmer Group
0
sage: E.rank_bound() # Computes a sometimes better bound
0
```

In these cases the 2-Selmer group is relatively easy to compute, because every point of order 2 on the elliptic curve is rational. It's behavior is determined, in a somewhat complicated way, by the prime factorization of $n*m*(n+m)*(n-m)$ and whether those primes are squares modulo one another.

The going conjecture is that if you pick $k$ "at random", the the rank of the elliptic curve Allan wrote down has about a 50% chance of being 0 and a 50% percent chance of being 1.

Unfortunately, some results of Gang Yu, and certain elliptic curve analogues of Malle's corrections to the Cohen-Lenstra heurstics, suggest that if you pick $k$ at random and compute the upper bound you will quite often get an upper bound of 2, or 4, or 6, or so on, even when the rank is 0. If you want to do something more exhaustive, you might need to do so-called higher descents. These are, at present, best done with Magma.

### EDIT STARTS HERE:###

For simplicity, I'm changing coordinates a bit starting from $W^2 = Z(Z-m^2)(Z-n^2)$ let $x = Z/m^2$ and $y = W/m^3$ then we see from Allan's answer above that a Heron triangle with side lengths $a, ka, b$ will give rise to a rational point on the elliptic curve
$$E_k : y^2 = x(x-1)(x-k^2)$$
other than $(0,0)$, $(1,0)$, or $(k.0)$.

The Mordell-Weil theorem (since we are working over $\Bbb Q$ I should probably call it Mordell's theorem) tells us that the group of rational points $E_k(\Bbb Q)$ is a finitely generated abelian group, thus isomorphic to $T_k \times \Bbb Z^{r_k}$ for some finite abelian group $T_k$ and some non-negative integer $r_k$.

Given an elliptic curve, the torsion subgroup is easy to compute in Sage:

```
sage: k = 1/3
sage: E = EllipticCurve([0,-1-k^2, 0, k^2, 0]).minimal_model()
sage: E.torsion_subgroup().invariants()
(2, 2)
```

but let me tell you what $T_k$ is for all $k$. Since we know that are $T_k$ contains the 3 points $(0,0)$, $(1,0)$, and $(k,0)$ of order 2, a deep theorem of Mazur assures us that $T_k$ is isomorphic to $\Bbb Z / 2 \Bbb Z \times \Bbb Z /2j\Bbb Z$ where $j = 1, 2, 3,$ or $4$.

I'm going to use the fact that Noam mentioned in the comments that $E_k$ precisely the quadratic twists by $-1$ of those elliptic curves with torsion subgroup $\Bbb Z/2 \Bbb Z \times \Bbb Z/4 \Bbb Z$. In particular, this means that there is a rational cyclic 8-isogeny among those elliptic curves isogenous to $E_k$ over $\Bbb Q$. If we had $j = 3$ then each of those isogenous curves would also possess a rational cyclic 3-isogeny. So there would be a rational cyclic 24-isogeny among these curves. This does not happen over $\Bbb Q$.

No let's consider the possibility of $j = 2$ or $j = 4$. If $E_k$ possesses a point of order 4 over $\Bbb Q$ then $E_k$ would have to possess 3 points of order 4 over $\Bbb Q(i)$. This will happen if and only if $k^2 - 1$ is a square up to sign. See for example:

```
sage: k = 3/5
sage: E = EllipticCurve([0,-1-k^2, 0, k^2, 0]).minimal_model()
sage: k^2 - 1
-16/25
sage: E.torsion_subgroup().invariants()
(2, 4)
sage: k = 5/4
sage: E = EllipticCurve([0,-1-k^2, 0, k^2, 0]).minimal_model()
sage: k^2 - 1
9/16
sage: E.torsion_subgroup().invariants()
(2, 4)
```

The condition that $E_k(\Bbb Q(i))$ contains 3 points of order 4 rules out the possibility of a point of order 8. Since I've already used Mazur's theorem classifying torsion subgroups over elliptic curves over $\Bbb Q$. I'll go ahead say that Kamienny's theorem classifying torsion subgroups of elliptic curves over quadratic fields and say that $E_k(\Bbb Q(i))$ cannot have 3 points of order 4 and a point of order 8. You rule out $j = 4$ in a simpler way that comes down to Fermat's $a^4 + b^4 = c^2$, but I won't do that now.

## So here is the best answer I can give to your question at present:

Let $k$ be a rational number. If there are infinitely many non-congruent Heron triangles with sides of the form $a, ka, b$ if then the Mordell-Weil rank of the elliptic curve
$$E_k : y^2 = x(x-1)(x-k^2)$$
is positive. If the Mordell-Weil rank of $E_k$ is zero, then there can, and will be finitely many congruence classes of Heron triangles with side lengths of the form $a, ak, b$ if and only if $k^2 - 1$ is a square up to sign. In particular one can take the right triangle with sides $1, k, \sqrt{|k^2 -1|}$.