Prime number check
https://code.sololearn.com/c59HnmxEt25C/# this is the most efficient way I could figure out to check if a number is prime, can this function be more optimized? Any advice?
But this will iterate more times ... why is it better ? CarrieForle
There are more advanced methods which are especially useful with very large numbers, and have rather complicated mathematical background, eg. Rabin-Miller. Read more on wikipedia https://en.m.wikipedia.org/wiki/Primality_test https://en.m.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test