# formula for rational length cevians in an equilateral triangle

I wrote a computer program that iterates through progressively larger scale triangles. The program seeks whole numbers m & n that represent distances from the base vertices, and when a whole number cevian appears. The cevians are always primes of formula 6n+1 (and multiples of them BUT not including primes not of formula 6n+1).

The first one: cevian=7, triangle side= 8, cevian goes from apex to a point on the edge of the base that is 3 from one base vertex and 5 from the other base vertex.

My results up till cevian length 7^4 are posted in a table here: https://mutaman.neocities.org/

Also recorded are the multiples of rt3 which are orthogonally oriented to these whole number cevians in an adjacent eqilateral triangle (albeit of a different scale). I included them just in case they might be useful in finding a formula to find the next cevian in the sequence. I am familiar with Stewart's theorem: a^2 = d^2 + m*n where 'a' is the scale, 'd' is the cevian length, and 'm' & 'n' are the distances from either vertex on the base. However I was not able to use it to predict the next cevian, because even though I new the next cevian's value I didn't know the scale of the triangle AND the m or n value. I tried using the values from cevians of smaller scale triangles and used ceva's theorem to combine the cevians but I couldn't find a predictive theory.

Is there a formula to generate these without having to find all cevians brute force and then exclude the ones that aren't whole number?

• From your data I'd rather infer $a^2=d^2+mn$. Sep 2, 2017 at 14:03

It seems you are looking for integer solutions $d$ of the equation $$(m+n)^2=d^2+mn, \quad\hbox{that is:}\quad d^2=m^2+n^2+mn,$$ where $m$ and $n$ are two positive integers. Due to symmetry, we may restrict our search to $m\ge n$. If we set: $S=m+n$ and $D=m-n$ the equation becomes: $$4d^2=3S^2+D^2, \quad\hbox{with}\ S>D.$$ Notice that $S$ and $D$ must be both even or both odd. Making now a further change of variables: $S=d+x$ and $D=d-y$ (with $x$ and $y$ positive integers and $y-x$ even) we obtain the equation: $$d={y-x\over2}+{2xy\over y-3x}.$$ This is fairly simple, but as you seem to be specially interested in prime solutions, we can set: $$t={y-x\over2} \quad\hbox{and}\quad u={y-3x\over2}.$$ Notice that $t$ and $u$ must be both positive integers with $t>u$, and $$d=u-3t+3{t^2\over u}.$$ If $u>1$ then $d$ cannot be a prime number, for all prime factors of $u$ must also be prime factors of $t$ and some of them remain as a global factor, due to $t>u$. All prime solutions must then be given by $$d=1-3t+3t^2, \quad\hbox{with}\quad t>1.$$
• $u=3$ and $t>3$ not a multiple of $3$; in this case: $$d=3-3t+t^2.$$
• $u=v^2$ ($v$ not a multiple of $3$) and $t=kv$, with $k$ and $v$ coprime; in this case: $$d=v^2-3kv+3k^2.$$
• $n=2t-u$, $m=d-t$. Sep 4, 2017 at 16:40