Created
March 3, 2016 01:21
-
-
Save z2s8/596100d412b34f643e70 to your computer and use it in GitHub Desktop.
Revisions
-
z2s8 created this gist
Mar 3, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ NUMBER_OF_PRIMES = 150000 primes = [2] test_number = 2 primes_found = 0 while primes_found < NUMBER_OF_PRIMES test_primitiveness = true i = 0 while (primes.size > i && primes[i] <= Math.sqrt(test_number) && test_primitiveness) if test_number % primes[i] == 0 test_primitiveness = false end i += 1 end if test_primitiveness primes << test_number primes_found += 1 end test_number += 1 end