Binary search to find out number of primes less than or equal to x
while ( l <= r ) { m = parseInt ( ( l + r ) / 2 ) ; if ( v [ m ] <= x ) { inn = m ; l = m + 1 ; } else { r = m - 1 ; } } return inn + 1 ; }