Calculate number of terms divisible by a and by b and by c then , remove the terms which is are divisible by both a and b , both b and c , both c and a and then add which are divisible by a and b and c
return ( parseInt ( num / a ) + parseInt ( num / b ) + parseInt ( num / c ) - parseInt ( num / lcm ( a , b ) ) - parseInt ( num / lcm ( b , c ) ) - parseInt ( num / lcm ( a , c ) ) + parseInt ( num / lcm ( a , lcm ( b , c ) ) ) ) ; }