Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

8 lines (6 sloc) 0.211 kB
import EulerMath.Divisors
hasAmicablePair :: (Integral a) => a -> Bool
hasAmicablePair n = d dn == n && n /= dn
where dn = d n
euler21 :: (Integral a) => a -> a
euler21 n = sum $ filter hasAmicablePair [2..n]
Jump to Line
Something went wrong with that request. Please try again.