Sorry, its square root.
:blush:
Printable View
Sorry, its square root.
:blush:
100 hours total run time now with over 407 million primes found.
I now have 100 million primes found and stored. I found out something dreadful. My machine appears to not calculate any primes when it drops into sleep mode. I have Windows doing this automatically after 3 hours of keyboard and mouse inactivity, so I have lost lots of real time calculations during the past few days. :blush:
My largest prime stored is still just under 1 billion, so you are running circles around me.
I don't know about you're computer, but mine "appears" to shut completely down when it enters standby mode. No amount of mouse movements or keyboard presses will bring it back. I have to press the power button. If I had to guess, I would say it only does RAM refresh during standby.
I just passed 10^10 magnitude. It took 121.6 hours. I have 484.3 million primes stored in archives. The percentage is 9.1.
The next milestone would be 10^11. If one does the progression, it would take 1,216 hours to reach it. That's just over 50 days total run time.
:)
Progress report:
My largest stored prime number just exceeded 3 billion. These numbers are being stored inside only two files, and the second one advances steadily in size. The first file requires 410.6 Mb of disk storage and contains all primes from 2 to 2^31.
The second file is now about 320 Mb in size and contains all primes exceeding 2^31. The program will eventually top out when the largest prime exceeds 10^10, although I could extend it to the limit of an external hard drive or with primes reaching 10^15 (whichever comes first) using no more than 8 bytes per prime.
This is truly an interesting project, but I fear that I am creating King Kong. What do I do with the beast after I create it? :eek:
Any suggestions?
@Code Doc:
I am back up to 152 million written. No data corruption this time. I think I know what the problem may have been:
If I am not mistaken, this is trying to do a double conversion to a string. The WriteLine method is described as "writing the string equivalent" of any expression.Code:DataFile.WriteLine(Cstr(Number))
Changing it to this, or back to this, whichever, removed the corruption. It is possible it may have changed it on one of my many touch-ups.Code:DataFile.WriteLine(Number)
Keep adding to it. If you get tired of it, the interest will return. It always has for me. Even if it took years waiting on new hardware.Quote:
Originally Posted by Code Doc
:)
I had to trash all my data again. I still have corruption problems. Non-numeric characters appearing in my numeric values. Not sure I will be able to solve the problem.
:sick:
Storm, that is a nightmare. I thought best to extract all prime numbers up to 10^10 before doing any validity testing. I have thus far found and stored all primes reaching about 6.1 x 10^9, so I am getting close. My two files that together store them all now total 1.6 Gb in size.
I wish there were some way I could help at this end. I feel your pain. :sick:
@Code Doc:
It was all for nothing. Read the link below.
http://www.vbforums.com/showthread.php?t=585609
:ehh:
Storm, I think my approach still makes the most sense. Build the data in a random acces fille stored packed as long integers and eventually as currency data types for the monsters over 2^31. Then when the files are eventually assembled, write code to play them back out as strings for visual display, examining whatever pieces of the files that you want to show.
No, it's not a sequential file, even though it is being assembled one record at a time. When built, any record on the file can then be accessed by an immediate leap to a specifiic record--such as record number 100 million, and the prime number can be immediately revealed. The only thing I have to do in code is examine the value of the desired prime number. If over 2^31, then I switch to the big primes being stored as currency.
Your progess is excellent. The value of the most recent prime that I have collected is about 6.9 billion. Total file size has now reached 2 GB.
I'm back above 6 billion in magnitude and have 3.4 GB stored. 72.8 hours run time.
I understand your file format now. Writing as sequential, but in a way that can enable reading as random. A user defined "type" with each record being the same size. I considered something like that. It would have been more drive-space efficient, but with two rather large drives, I opted for plain text stacked; not CSV.
Sooner or later, a better algorithm is going to be a must. I'm still searching. It's hard to find anything practical with examples easy to understand.