Skip to content

Instantly share code, notes, and snippets.

@jakedobkin
Created November 10, 2011 22:47
Show Gist options
  • Save jakedobkin/1356516 to your computer and use it in GitHub Desktop.
Save jakedobkin/1356516 to your computer and use it in GitHub Desktop.
Euler Problem 3
<html>
<body>
<script type="text/javascript">
c = 600851475143;
for (i=3;i<=775146;i++)
{
if (c%i == 0){
document.write(i + " is a possible prime factor"+ "<br/>");
for (j=3;j<=i;j++)
{
if(i%j == 0 && j<i)
{
document.write("... but " + i + " is not prime<br/>");
break;
}
}
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment