# What would the 3D graph of GCD(x, y) and LCM(x, y) look like?

To find the answer out, I was going to use a graphing calculator but I couldn't find any one that supports the two operations. I would try to draw by hand but since it'll a 3D graph, I would have to use domain coloring and that would be a lot of work and hard to interpret. So, I ask: What does the graph look like for each function, and does it have an extension like factorials where it extends to real and rational numbers too having it as a codomain (such as if $$1.5!$$ has a real result, does $$\gcd(1.5, 1.2)$$ have one too)?

## 1 Answer

The gcd(x,y) is only really defined for x & y in the natural numbers (or for intigers if you allow negatives and 0 but nothing really changes to allow those).

The first fact to consider if you were looking to extend how you allow the gcd to work would be to make the requirement for gcd(x,y)lcm(x,y)=xy

If we let x=a/b and y=c/d where a, b, c & d are all intigers (thus the fraction of x & y) then we could define gcd(a/b,c/d) = gcd(alcm(b,d)/b, clcm(b,d)/d)/lcm(b,d) Through this idea we can do gcd(1.5,1.2)=gcd(3/2,6/5)=gcd(3*lcm(2,5)/2,6*lcm(2,5)/5)/lcm(2,5)=gcd(3*10/2,6*10/5)/10=gcd(15,12)/10=3/10

The idea of gcd(1.5,1.2)=0.3 does look like it would make nice intuitive sense.

Edit: By looking at lcm(b,d) =bd/gcd(b,d) the odd formula seems to nicely fall down to just... gcd(a/b, c/d) = gcd(ad, cb)/(bd)

• This solution would have extreme obscillations as you can easily find rationals with similar values but no or many common factors. Anyway I can't see why this solution deserved a downvote. – N74 Oct 14 '18 at 19:30