Here you can find the source of lcm(long x, long y)
static long lcm(long x, long y)
//package com.java2s; //License from project: Open Source License public class Main { static long lcm(long x, long y) { return x * y / gcd(x, y); }/*from w ww . j a va2s .c o m*/ static long gcd(long x, long y) { long a = x, b = y, r = 0; while (b != 0) { r = a % b; a = b; b = r; } return a; } }