Anonymous user
Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions
Sequence: smallest number greater than previous term with exactly n divisors (view source)
Revision as of 14:05, 16 July 2020
, 3 years ago→{{header|Haskell}}
Line 308:
divisorCount = length . nub . foldr (\(a, b) r -> a:b:r) [] . divisors
where
divisors n = [ (x, n `div` x)
| x <- [1..ceiling (sqrt $ realToFrac n)]
, n `mod` x == 0]
|