Jump to content

Sequence: nth number with exactly n divisors: Difference between revisions

m
No edit summary
Line 414:
calc n = do
x <- [1..]
guard (even n || odd n && f x ^ 2 == x)
[(x, divisorCount x)]
where f n = floor (sqrt $ realToFrac n) ^ 2
 
havingNthDivisors :: Integer -> [(Integer, Integer)]
Line 465:
(29,1116713952456127112240969687448211536647543601817400964721)
(30,6768)</pre>
 
=={{header|Java}}==
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.