Skip to content

Instantly share code, notes, and snippets.

@nemanjan00
Created June 20, 2016 15:10
Show Gist options
  • Save nemanjan00/23869d3fce0379363371610bc7496fc5 to your computer and use it in GitHub Desktop.
Save nemanjan00/23869d3fce0379363371610bc7496fc5 to your computer and use it in GitHub Desktop.
function prost(n){
for(var i = 2; i <= math.Sqrt(n); i++){
if(n % i == 0){
return false || n == 2;
}
}
return true;
}
var prosti = [];
for(var i = 2; ; i++){
(prost(i) && prosti.push(i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment