# Finding integers of the form $3x^2 + xy - 5y^2$ where $x$ and $y$ are integers, using diagram via arithmetic progression

So the diagram drawn looks like this:

We begin at the edges labeled $3$ and $-5$ because we are using those as the bases for $x$ and $y$, respectively. The way we obtain the values of the 2 adjacent vertices besides these bases labeled $-3$ and $-1$, is we use the arithmetic progression $(a + c) + b$ where $a = 3$, $c = -5$, and $b = 1$ (the coefficient values of the quadratic). Since we are moving towards the right, we add when we go to the right, so $(3 + -5) + 1 = -1$ on the right of the bases, but $(3 + -5) - 1 = -3$ to the left of the bases since we have to subtract the value to go backwards in an arithmetic progression.

What I don't understand is how we obtain the other values for the vertices in this diagram tree. Obviously they are integers represented by the form $3x^2 + xy - 5y^2$ where $x$ and $y$ are integers (e.g. for $x = 2$ and $y = 1$, we have $3(2)^2 + (2)(1) - 5(1)^2 = 9$ which is on the diagram). The formula I was able to obtain by trial and error is to add up the 2 adjacent edges of the vertice I want to find, multiply that by $2$, then subtract the vertice directly before it from that product (e.g. $9 = (2 * (3 + -1)) - (-5)$) (e.g. $25 = (2 * (9 + 3)) - (-1)$), but this doesn't mean anything to me.

How do we apply arithmetic progression here? And why does this method work in obtaining the integer representatives of the form $3x^2 + xy - 5y^2$ where $x$ and $y$ are integers?

• see maths.ed.ac.uk/~aar/papers/conwaysens.pdf and several of my answers, for example math.stackexchange.com/questions/1132187/… – Will Jagy Feb 4 '15 at 2:19
• So, what is the source of this partial diagram?? – Will Jagy Feb 4 '15 at 2:27
• @WillJagy Lecture notes from class – mr eyeglasses Feb 4 '15 at 2:29
• In that case you can reasonably expect to extend the diagram and find all the numbers between, say, $-70$ and $70$ that are primitively represented, meaning $\gcd(x,y) = 1.$ I suggest you do that much, very, very carefully, by reading the chapter in the Conway book I mention above. – Will Jagy Feb 4 '15 at 2:48
• $3,1,-5$ are all odd. It is not possible for $3x^2 + xy - 5 y^2$ to be even unless both $x,y$ are even. If that is the case, then $\gcd(x,y) \neq 1.$ The diagram you are working on shows only the gcd 1 numbers. Everything else can be found, if desired, by multiplying by arbitrary squares (but not altering the diagram). – Will Jagy Feb 4 '15 at 18:17

Takes a while to draw these; I was hoping the OP would try, it is really the activity of doing the diagrams that explains things. Anyway, the Conway topograph diagram for an indefinite form, in this case $3 x^2 + x y - 5 y^2,$ has a number of elements, so I draw them in various colors. I draw the values in pink, maybe it is magenta or fuchsia. There is a "river" that separates the positive values and the negative values. If two values that share an edge, that edge gets a number (Conway usually wrote $h$) and a little arrowhead, with values $a,b$ and correct interpretation of the arrow, either the form $a x^2 + h x y + b y^2$ or $a x^2 - h x y + b y^2$ is $SL_2 \mathbb Z$ equivalent to $3 x^2 + x y - 5 y^2.$ For each value in pink, there are $(x,y)$ coordinates in green, I mostly put those as a column vector.

I think I can do better about the little blue arrows, with positive blue number $h.$ If you print out the image and rotate it so that the edge is vertical and the arrowhead points up, then the value in the region bordering the edge on its left is $a,$ and the value on its right is $b,$ giving $a x^2 + h x y + b y^2.$ For example the original $3$ has green $(x,y)$ coordinates $(1,0),$ then there is a vertical edge labelled $13$ in blue with up arrow, then value $9$ with coordinates $(2,1).$ The form $3 x^2 + 13 xy + 9 y^2$ is $SL_2 \mathbb Z$ equivalent to $3 x^2 + x y - 5 y^2.$

Finally, Conway's theorem that "the river is periodic" leads also to the generator of the oriented automorphism group appearing in the diagram itself, as two green column vectors placed side by side. I really like this feature, not emphasized in either Conway's book or Stillwell's. Given that it took two pages to illustrate the periodicity of the river (a little overlap in the diagrams), I would have gotten more readable jpegs if i had used graph paper with three squares per inch instead of four.

Right, after the two pages showing the river and the automorphism matrix, I decided to expand one of the trees that shows a good deal of the diagram the OP posted. As far as drawing these things, i have a way that saves space, a somewhat unpredictable diagram of conditions along the river itself, then a tree diagram that expands around one tree trunk that leaves the river. Conway's climbing Lemma says that values increase in absolute value as we move away from the river, the word "away" refers to height/(number of branches from the trunk) in one of these trees.

Drawn on three squares per inch paper, seems more readable to me,

I think you can see a little better here how the blue arrows vary quite a bit on the river itself, sometimes left and sometimes right, but for the tree trunks reaching the river they always point up. So, with negative values, the original form is $SL_2 \mathbb Z$ equivalent to $-15 x^2 + 31 xy - 15 y^2.$

Probably wise to emphasize the arrows on the river, especially where the value is $3$ with $(x,y)$ coordinates $(8,7),$ while the other value $-5$ has coordinates $(9,8).$ The blue number in the edge between them is $1.$ However, the arrow points left, while the arrow for the original form points right. As a result, the evident matrix $$\left( \begin{array}{rr} 8 & 9 \\ 7 & 8 \end{array} \right)$$ is not part of the automorphism group. We find $$\left( \begin{array}{rr} 8 & 7 \\ 9 & 8 \end{array} \right) \left( \begin{array}{rr} 6 & 1 \\ 1 & -10 \end{array} \right) \left( \begin{array}{rr} 8 & 9 \\ 7 & 8 \end{array} \right) = \left( \begin{array}{rr} 6 & -1 \\ -1 & -10 \end{array} \right)$$

On the other hand, switching to matrices with determinant $-1,$ we find the "improper automorphism"

$$\left( \begin{array}{rr} 8 & 9 \\ 7 & 8 \end{array} \right) \left( \begin{array}{rr} 1 & 0 \\ 0 & -1 \end{array} \right) = \left( \begin{array}{rr} 8 & -9 \\ 7 & -8 \end{array} \right)$$

which has negative determinant, and

$$\left( \begin{array}{rr} 8 & 7 \\ -9 & -8 \end{array} \right) \left( \begin{array}{rr} 6 & 1 \\ 1 & -10 \end{array} \right) \left( \begin{array}{rr} 8 & -9 \\ 7 & -8 \end{array} \right) = \left( \begin{array}{rr} 6 & 1 \\ 1 & -10 \end{array} \right)$$

• Thanks Will. I ended up failing the course and vowing to never work with number theory again, but maybe I will give this another shot in the future. – mr eyeglasses Oct 8 '15 at 19:28
• @morphic, sorry to hear that. This is not one of the forms i would have chosen to introduce the technique, rather intricate diagram; or, rather, several steps to reach the point that confirms periodicity of the river. – Will Jagy Oct 8 '15 at 19:33
• Nice. Would you tell me please what does OP mean? It is a question of English. Thanks by advance. – Piquito Oct 9 '15 at 19:26
• @WillJagy: I asked about the OP appearing in the first line of your answer. Many times this OP appears and certainly has a well known mean I do not know. – Piquito Oct 9 '15 at 19:49
• @Ataulfo, oh. The OP is the person that makes the Original Post, in this case the question. This is not standard English, it is just used on some websites, maybe only this website – Will Jagy Oct 9 '15 at 19:51