Numbers whose count of divisors is prime: Difference between revisions

Content added Content deleted
Line 97: Line 97:
<lang julia>using Primes
<lang julia>using Primes


ispdc(n) = (ndivs = prod(collect(values(factor(n))).+1); ndivs > 2 && isprime(ndivs))
ispdc(n) = (ndivs = prod(collect(values(factor(n))).+ 1); ndivs > 2 && isprime(ndivs))


foreach(p -> print(rpad(p[2], 8), p[1] % 10 == 0 ? "\n" : ""),
foreach(p -> print(rpad(p[2], 8), p[1] % 10 == 0 ? "\n" : ""),