

Thread Tools 
20210509, 01:12  #1 
May 2021
7 Posts 
How to get to a prime from the previous prime number (sieve of Eratosthenes rediscovered)
I found a solution that will calculate each consecutive prime number from the previous prime number. I wrote about it in a humorous blog, but understand that it is actually true.
Read about it here: http://www.millieandtheboys.com/isolvedprime/ How does one verify a math discovery?? Addie 
20210509, 01:34  #2 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
9,931 Posts 

20210509, 01:49  #3 
May 2021
7 Posts 
Am I crying Wolf?? Ha
Guys, I’m not bluffing. If you read the blog and look at the output files, those are actually calculated using an algorithm. I have all the data to back it up.

20210509, 10:46  #4 
Feb 2008
Meath, Ireland
3·61 Posts 

20210509, 12:03  #5 
May 2021
7 Posts 
That's fair. I'll get right to it then!
I've attached the following files: Millie_Code_Prime_Solver_VB_Notepad.txt  this is the code from VB copy and pasted so that you can see it. Prime.exe  Try it! If you leave the n and m as the default, it will calculate the first 100 prime numbers and place them into an output text file. You must change the output file location to match where the .exe file is and choose a file name. Mod note: The .exe has been put in a zip with the password of: password This is to protect people from accidentally running code from an unknown source on their machine. output.txt  This is the output when the defaults are left as n = 100 and m = 10000. The first column is counting primes and the 2nd column is the prime number. The second prime number is '3' and the 99th prime number is '523' and everything in between. I posted a few photos so that you can see I had to boot up my old computer (because that's where I have VB) to grab the VB code and paste it into Notepad. The files on my computer were saved on April 8, 2018, which is the weekend I did this... just to show you that there is truth to this. (The 2003 file was actually saved today, but my old computer doesn't work unless I enter an old date...) I should add, that I visualize all this in Excel. It's incredible and also reveals why there will always be twin primes! Verify away :) Last fiddled with by Uncwilly on 20210509 at 20:18 Reason: Change .exe to a zip 
20210509, 12:27  #6 
May 2021
7 Posts 
You can change the input values to calculate more or less prime numbers (n). Just note that input m needs to get exponentially greater as you choose to calculate more primes. It’s basically a guess at how many “rows” are required and many of them are filled with zeros. If your m isn’t large enough it won’t complete the calculation properly. I’m sure there is a way to streamline this, but my coding skills are very limited.

20210509, 17:24  #7 
Jan 2021
California
454_{10} Posts 
At a quick glance at the code this appears to be a basic implementation of the sieve of Eratosthenes. This is a well known method, and works well to generate very small primes.
This is not going to find record sized primes, you won't even find 20 digit primes with this, you will be out of memory and time very quickly. 
20210509, 19:21  #8 
Feb 2017
Nowhere
7×853 Posts 
Looks like a sieve to me. Sieving is useful to eliminate composites with small prime factors from a candidate list, but as a standalone primeproving method you would have to sieve out by all the primes up to the square root of your candidate, which be prohibitively slow for numbers of any size.
Also, I also noticed that a lot of the loops had file reads and writes. I'm no computer expert, but I think even with fairly small numbers, that would tend to slow things down a great deal. Some packages have functions that give the next (probable) prime, such as PariGP's nextprime() function. If my understanding is correct, it excludes multiples of 2, 3, 5, and 7 as candidates (for arguments larger than 6, anyway), and applies its BPSW pseudoprime test until it finds a number that "passes" the test. The output is not guaranteed to be prime, but if it is not very large (say a couple hundred decimal digits) Pari's isprime() primeproving function could then be used to be certain. "Everybody knows" there are infinitely many composite numbers that are BPSW probable primes, but nobody knows how to prove it, and AFAIK not a single example has been produced. 
20210511, 00:19  #9  
May 2021
7 Posts 
Quote:


20210511, 00:24  #10 
May 2021
7 Posts 
I posted my Excel worksheet and reposted my VB code file with explanations of how it was programmed. If anyone is interested, you can see a little more into my thinking and how each column of values produces the next prime number.
I don’t know if this is just a backwards way of coming up with a sieving method. It is how I started in the process and then I looked for patterns that could be repeated. I have a note that the rows for the code developed for each column is the previous prime squared (gets large quickly, but there are a lot of wasted zero values). The code itself (by code, I mean the column of values below the blue box number) has a midpoint and mirrors itself back to the start. It grows from the midway point and why I speculate that there will always be twin primes since those “twos” will eventually add to the next prime number. Btw, a lot of those read and writes within loops was me troubleshooting the process and the final version placed a “ ‘ “ in front so that the program ignores the command. The only write command occurs at each prime number. It is, however, a tedious method of looking at every row to check if the value is ‘zero’ or not. Anyway, that's all I've got! I will likely take a quiet leave from math forums, but it was fun. :) Good luck finding the BIG ones. 
20210511, 00:45  #11 
Aug 2002
2^{2}×3×709 Posts 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Sieve of Eratosthenes  bhelmes  Number Theory Discussion Group  44  20220910 07:56 
Visualising the Sieve of Eratosthenes  a nicol  Miscellaneous Math  0  20201020 14:05 
New GPU accelerated sieve of Eratosthenes  cseizert  Programming  8  20161027 05:55 
Sieve of Eratosthenes  Raman  Programming  4  20090119 17:12 
Sieve of Eratosthenes  jchein1  Homework Help  6  20070827 13:51 