0

Write a code that can tell if a number is a prime number

4th Sep 2017, 11:06 AM
Uzondu Obillor
Uzondu Obillor - avatar
3 Respuestas
+ 2
https://code.sololearn.com/cNNTzSL9tlV3/?ref=app
4th Sep 2017, 11:14 AM
Luca
Luca - avatar
+ 1
this is my code, as it uses the square root of the number you are checking as a limit, and uses only prime numbers in the array "primes", it is the fastest algorythm; note that you can check only numbers which are < of P*P, where P is the biggest prime number in the array (all the prime numbers between 2 and P must be present and ordered in the array) https://code.sololearn.com/cn1cz2EdhtBP
4th Sep 2017, 11:45 AM
Ludo
Ludo - avatar