Möbius function: Difference between revisions

Content added Content deleted
(Add a section for the Rust language as well as a solution.)
m (Correct fact in rust code comment)
Line 2,209: Line 2,209:
}
}


// If x is a prime it will never be divided by any factor <= its square root.
// There can exist one prime factor larger than √x,
// In that case we can check if x is still larger than one, and then count it.
// in that case we can check if x is still larger than one, and then count it.
if x > 1 {
if x > 1 {
prime_count += 1;
prime_count += 1;