Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as HTML by s.r ( 14 years ago )
<html>
[removed]
function go(n) {
  var a = new Array(n);
  a[0] = 2;
  ii = 1;
  for(i = 3; ii < n; i+=2) {
    tof = Math.sqrt(i);
    test = true;
    for(j = 0; a[j] <= tof; j++)
      if (i % a[j] == 0)
        test = false;
    if (test) {
      a[ii] = i;
      ii++;
      //document.body.appendChild(document.createTextNode(i+" "));
    }    
  }
  alert&#40;a[a.length - 1]&#41;;

}
[removed]
<body>
<form>
<input name="data" value="10000" />
<input type="button">
</form>
</body>
</html>

 

Revise this Paste

Children: 22263
Your Name: Code Language: