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:29, 16 July 2020
, 3 years ago→{{header|Haskell}}
Line 306:
sequence_A069654 = go 1 nDivCount
where
nDivCount = (,) <*>
▲ divisors n = [1..ceiling (sqrt $ realToFrac n)] >>= \x ->
▲ guard (n `mod` x == 0) >> [x, n `div` x]
go t ((n,d):xs)
| d == t = (t,n):go (succ t) xs
|