strictly the recursive solution above is for gcd - it is useful since lcm can be reduced to gcd as explained here
another formulation of lcm is in terms of powers of prime factors - there may be recursive prime factorization algorithms - I don’t know one way or another