Function for Sieve of Eratosthenes
function sieve ( prime , n ) { prime [ 0 ] = false ; prime [ 1 ] = false ; for ( var p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( var i = p * p ; i <= n ; i += p ) prime [ i ] = false ; } } }