Skip to content

Instantly share code, notes, and snippets.

@ichyo
Created June 13, 2010 12:32
Show Gist options
  • Save ichyo/436626 to your computer and use it in GitHub Desktop.
Save ichyo/436626 to your computer and use it in GitHub Desktop.
prime = Array.new
count = 1
prime[0] = 2
prime[1] = 3
no = 5
while count<10000 do
for i in (1..count)
break if (no % prime[i] == 0)
end
if (i == count)
count += 1
prime[count] = no
print no , "\n"
end
no += 2
end
print prime[10000]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment