truncate . sqrt . fromIntegral

--
-- 整数か？(小数点以下は 0 か？)
--
isInteger :: RealFrac a => a -> Bool
isInteger = (== 0) . snd . properFraction

--
-- 下降階乗冪
primitivePythagoreanNums :: Integral a => a -> [(a, a, a)]
primitivePythagoreanNums n =
    [(a, b, c) | (a, b, c) <- pythagoreanNums n, gcd a b == 1]
primitivePythagoreanNums n =
    [(a, b, c) | (a, b, c) <- pythagoreanNums n, gcd a b == 1]