divideOut n p k =
    let (q, r) = quotRem n p
        in if r == 0
           then divideOut q p (k + 1)
           else (n, k, p > q)
divideOut n p k =
    let (q, r) = quotRem n p
        in if r == 0
           then divideOut q p (k + 1)
           else (n, k, p > q)
divideOut n p k =
    let (q, r) = quotRem n p
        in if r == 0
           then divideOut q p (k + 1)
           else (n, k, p > q)