Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 30th, 2010  |  syntax: Haskell  |  size: 0.21 KB  |  views: 45  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. nbFactors 1 _ = []
  2. nbFactors x (p:ps) = exponent : nbFactors rest ps where
  3.     (exponent,rest) = countClean 0 x
  4.     countClean e y = case divMod y p of
  5.         (y',0) -> countClean (e+1) y'    
  6.         _ -> (e,y)