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 15:07, 16 July 2020
, 3 years ago→{{header|Haskell}}
Line 303:
sequence_A069654 :: [(Int,Int)]
sequence_A069654 = go 1
where
divisors n = [1..floor (sqrt $ realToFrac n)] >>= \x -> do
guard (n `mod` x == 0)
let y = n `div` x
if x == y then [x] else [x,y]
go t ((n,d):xs) | d == t = (t,n):go (succ t) xs
main :: IO ()
|