Function to check that a number is a prime or not in O ( Math . sqrt ( N ) )
function isPrime ( N ) { if ( N < 2 ) return false ; if ( N < 4 ) return true ; if ( ( N & 1 ) == 0 ) return false ; if ( N % 3 == 0 ) return false ; let curr = 5 , s = Math . floor ( Math . sqrt ( N ) ) ;