Anonymous user
Sequence: smallest number with exactly n divisors: Difference between revisions
Sequence: smallest number with exactly n divisors (view source)
Revision as of 11:37, 4 September 2019
, 4 years ago→{{header|Julia}}: More functional expressions
(→{{header|Julia}}: shorter and more efficient numfactors) |
(→{{header|Julia}}: More functional expressions) |
||
Line 347:
=={{header|Julia}}==
<lang julia>using Primes
numfactors(n) = reduce(*, e+1 for (_,e) in factor(n); init=1)
A005179(n) = findfirst(k -> numfactors(k) == n, 1:typemax(Int))
println("First $N terms of OEIS sequence A005179: ")▼
println(map(A005179, 1:15))
</lang>{{out}}
<pre>
|