Jump to content

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

→‎{{header|Julia}}: shorter and more efficient numfactors
(→‎{{header|Julia}}: shorter and more efficient numfactors)
Line 350:
<lang julia>using Primes
 
fnumfactors(n) = reduce(vcat*, [f*p^je+1 for j(_,e) in 1:e],factor(n); init=f1)
function numfactors(n)
f = [one(n)]
for (p,e) in factor(n)
f = reduce(vcat, [f*p^j for j in 1:e], init=f)
end
length(f)
end
 
function A005179(N)
Line 377 ⟶ 371:
1 2 4 6 16 12 64 24 36 48 1024 60 4096 192 144
</pre>
 
 
=={{header|Kotlin}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.