For the $gcd(x,y)$ we note:
$gcd(x,0) = x$
$gcd(x,succ(y)) = gcd(succ(y),mod(x,succ(y)))$
$succ(x)$ and $mod(x,y)$ are both primitive recursive, so $gcd(x,y)$ must be as well.
$z = lcm(x,y)$ if $x|z$ and $y|z$ and when $x|w$ and $y|w$, $z \leq w$. Show that $z = lcm(x,y)$ is primitive recursive.
Can we define $lcm(x,y)$ the same way $gcd$ is defined above? I feel that there should be some way to incorporate the two together (such that $lcm$ depends on $gcd$). How can we show that $lcm$ is primitive recursive?
How about this: $$\operatorname{lcm}(x,y) = \frac{xy}{\gcd(x,y)}?$$