Hello, this is my very own prime number generator Press the flag and watch the magic. Honestly I wouldn't be surprised if some of the numbers generated aren't prime, but if you want to look for a non-prime number in the list be my guest :) Made in like 15 minutes
-Basic Method Rundown- Whole Method: Try dividing a number by every number below it except one, and if any of the results are a whole number, then your number is not prime. This method is very inefficient, and only generates about 600 prime numbers in the first 10 seconds. (This rate gets slower as time continues, and this is true for any method you use) Prime Method: Instead of dividing by every whole number below the number you're testing, you can just try all the prime numbers below it. This is because dividing non-prime numbers is redundant. If you've already tried dividing by 3, then you don't need to try 6, 9, 12, or any other multiple of 3. This allows the program to generate 1,300 prime numbers in the first 10 seconds. Square Root Method: Instead of trying to divide by every number below your "potential prime", just divide by every number below its square root. This works because every number contains factors in pairs, so it's possible to infer what the other factor is if you know just one. If you know that 2 is a factor of 16, you can figure out that 8 is also a factor because 2 * 8 = 16. This method improves the algorithm quite a lot, giving it a starting rate of 5,300 primes in the first 10 seconds. Prime Root Method: Use the prime method and root method at the same time. This allows the program to generate a whopping 18,000 primes in the first 10 seconds!