Numbers whose count of divisors is prime: Difference between revisions

Content added Content deleted
(→‎{{header|ALGOL 68}}: No need for a prime sieve - primes have a divisor count of 2.)
(→‎{{header|Go}}: Slightly simpler.)
Line 141: Line 141:
import (
import (
"fmt"
"fmt"
"math"
"rcu"
"rcu"
)
)
Line 152: Line 151:
k = 2
k = 2
}
}
for ; i <= int(math.Sqrt(float64(n))); i += k {
for ; i*i <= n; i += k {
if n%i == 0 {
if n%i == 0 {
count++
count++