AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Is It Divisible by Four?
If you have a rough estimate for this square root of 11, you don't actually have to check is it divisible by four. All you have to check in the case of 11 is is itDivisible by two? Is it Divisible by three? And we go all the way to is a divisible by nine. The answer is nine is no, 10 times in a row. So now we know 11 is a prime number. On the other hand, if we already know that two, three, five, and seven are prime numbers. You can also stop iterating when you have reached the square root of n. Before you get to a better algorithm than that, you have