[Haskell-cafe] Zumkeller numbers

Ketil Malde ketil at malde.org
Tue Dec 8 02:44:52 EST 2009

"Richard O'Keefe" <ok at cs.otago.ac.nz> writes:

> factors n = [m | m <- [1..n], mod n m == 0]

  -- saves about 10% time, seems to give the same result:
  factors n = [m | m <- [1..n `div` 2], mod n m == 0]++[n]

(But checking against primes is even faster, it seems)

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list