1

In other words, so to speak, how would I create a formula that would solve $$(\sqrt{(x | Z[a])^2 + (y | Z[b])^2}) | Z[a]$$ for either $x$ or $y$, given the other?

In English, what I want is a sequence of coordinates with $x$ as a multiple of $a$, and $y$ as a multiple of $b$, with the length of the line drawn between them also being a multiple of $a$, given that $a$ and $b$ are integers. If this is even possible.

  • I think I understand your question, but your notation is non-standard. When you wrote $(x \mid Z[a])$, I think you mean that you want $x = ma$ for some integer constant $m$. Similarly, I think you mean $y = nb$ for some integer $n$. So couldn't you restate your question as "I'm looking for integer solutions to $\sqrt{(ma)^2 + (nb)^2} = pa$" or something like that? – mathmandan Dec 12 '14 at 18:41
  • @mathmandan I used $Z[a]$ to denote that $a$ is an integer, I wasn't sure how else to represent that into an equation, and as far as I have read $x | a$ means that $x$ is a multiple of $a$. The important part is that this whole thing (((x|Z[a])2+(y|Z[b])^2)^(1/2) is also a multiple of $a$. For example, if $x$ is a multiple of 5 and $y$ is a multiple of 7, how do you calculate $x$ or $y$ such that the the line that connects the coordinate with 0 is also a multiple of 5? – AshRubigo Dec 12 '14 at 20:13
  • It would be more standard to write $a \in \mathbb{Z}$ to indicate that $a$ is an integer. In Latex, that would be "a \in \mathbb{Z}". People don't generally put that into an equation, you'd say it separately. Like, "find $a, b, m, n, p \in \mathbb{Z}$ that satisfy the following equation". Also, I think $a\mid x$ denotes that $x$ is a multiple of $a$, not the other way around. Ex: $2\mid 6$; not $6 \mid 2$. Anyway, if you set $x = ma$ (so $x$ is a multiple of $a$), and $y = nb$, then I think setting the whole square root expression equal to $pa$ would do what you want...? – mathmandan Dec 12 '14 at 20:44
  • Yeah, you're right, but I still need to find the relationship between $m$, $n$, and $p$, given $a$, and $b$, such that I can place that into a convenient function. Considering that inserting a value into either $m$, $n$, or $p$ may result in the other two being impossible, what would the function be in terms of? – AshRubigo Dec 12 '14 at 22:02

1 Answers1

0

So here's our restatement (see discussion in comments above): $$ (ma)^2 + (nb)^2 = (pa)^2 $$ Please note that this means that $(ma, nb, pa)$ must form a Pythagorean triple, with hypotenuse $pa$. So you're trying to find all Pythagorean triples where the hypotenuse and one of the legs have a common divisor, $a$.

http://en.wikipedia.org/wiki/Pythagorean_triple

Since every pair of integers has a common divisor (in some cases the GCD is 1, but it's still a common divisor), you basically just need to find all Pythagorean triples.

Note: if the three sides of a Pythagorean triple are all coprime, then we call it a primitive Pythagorean triple. If any two sides in a Pythagorean triple have a common divisor $d$, then all three sides share that divisor (why?), so every Pythagorean triple is a multiple of a primitive Pythagorean triple. Thus you may always take $b=a$ in our equation above, and solutions with $a=1$ correspond to primitive Pythagorean triples.

There are various formulas for generating Pythagorean triples, which would solve your problem completely.

mathmandan
  • 2,014
  • For anyone wondering, I used Euclid's formula to generate the triples, which is $x = k(m^2 - n^2), y = k(2mn), c = k(m^2 + n^2)$, where $m$, $n$, and $k$ are positive integers with $m > n$, $m - n$ odd, and with $m$ and $n$ coprime. $k$ is the common divisor of all the sides, and then simply checking that $x$ modulus $b$, and $c$ modulus $b$ are equal to 0 will ensure that $x$ and $c$ (the hypotenuse) are multiples of $b$. – AshRubigo Dec 14 '14 at 07:52