divisible n m = (mod m n)==0 -- predicato vero sse m e' divisibile per n divisiblebyboth n m x = (divisible n x)&&(divisible m x) commonmultiples n m = numsatP (divisiblebyboth n m) mcm n m = head (commonmultiples n m) -- Altra possibile implementazione: firstcommon (x:xs) (y:ys) | xy = firstcommon (x:xs) ys | otherwise = x allmultiple n = numsatP (divisible n) mcm2 n m = firstcommon (allmultiple n) (allmultiple m)