Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions

m
Line 306:
countDivisors n = foldr f 0 [1..floor (sqrt $ realToFrac n)]
where
f x r | n `mod` x == 0 = let y =if n `div` x in if x == yx then r+1 else r+2
| otherwise = r
go t ((n,c):xs) | c == t = (t,n):go (succ t) xs
Anonymous user