function gcd(m,n) { if (n==0) return m; else return gcd(n, m%n); } function lcm(m,n) { o = gcd(m,n); p = (m * n) / o; return p; }