Hi
I am doing problem 21 in eulerproject.
One part requires finding the list of proper divisors of a number. i.e. where there is remainder of n
and some number of less than n
. So I made this Haskell, but GHCI gets angry at me.
divisors n =[ n | n <- [1..(n-1)], n `rem` [1..(n-1)] ==0 ]
The problem is that I don't know how to make:
n `rem` [1..(n-1)]
so that it only returns the number less than n
that divide evenly into n
.