foo :: [(Integer,Integer)] -> Bool foo [] = True foo ((x,y):xs) = x `mod` y == 0 && foo xs
bar :: Integer -> [(Integer,Integer)] bar n = [(i,j) | i <- [1..n], j <- [1..n], 2 * i + j <= n, i + 2 * j <= n]