List of Primes

Started by
33 comments, last by UraniumRod 23 years, 11 months ago
Yanroy - Well I have the first 121 573 000 prime numbers in a 463 MB binary file . And that sack thing is an interesting idea to save space in a very space restrictive environment.

CobraA1 - Yah they are related to cryptography but we are talking about huge 70+ digit prime numbers. They make public keys possible.

Buster - I sence a little scarcasim

WOW!!! This is odd. I never knew prime numbers were so compressable. It seems that WinZip made my 463 MB file a 3.79 MB file?!?! That dosent seem right but if any one wants the zip file they can have it I'll be hanging out in #gamedev on IRC

Edited by - UraniumRod on 5/1/00 2:34:39 PM
------------------------------"My sword is like a menacing cloud, but instead of rain, blood will pour in its path." - Sehabeddin, Turkish Military Commander 1438.
Advertisement
Of course prime numbers are used in hash tables (table sizes are best if prime).


Mike
"Unintentional death of one civilian by the US is a tragedy; intentional slaughter of a million by Saddam - a statistic." - Unknown
I think this is kind of the same track that Vetinari was on.

Qqy, your teacher must have been a sadist. That rule is true for all primes.

Theorem:
3 < p < +infinity
If p is prime, then either (p + 1) or (p - 1) is divisible by 6.

Proof: (Not my work)
(1) If p is prime, then it is odd. (p > 2)
(2) If p is odd, then (p + 1) and (p - 1) are even.
(3) If (p + 1) and (p - 1) are even, they are both divisible by 2.
(4) p-1, p, and p+1 are consecutive integers.
(5) Given any three consecutive integers, one of them must be divisible by three.
(6) p is not divisible by 3; it is prime.
(7) Either (p-1) or (p+1) must be divisible by 3. [(4), (5), & (6)]
(8) A number which is divisible by both 2 AND 3 is divisible by 6.
(9) One of (p-1) or (p+1) must be divisible by 6. [(3), (7), & (8)]
Yeah, if I had thought about it for another second I would have realized that all the remaining numbers are divisible by 2 or 3, not just most. Someone saying that rule stoppeed working through me off. Thanks WM.

Mike
"Unintentional death of one civilian by the US is a tragedy; intentional slaughter of a million by Saddam - a statistic." - Unknown
quote:Original post by Qoy

Yeah, I know it doesn''t work in all cases, but the thing my teacher was saying that it will find all primes (I am NOT saying I agree with this!! that''s just what he said), as well as some non-primes..


I don''t stand by the validity of it but I was just throwing in some info.

Good luck!


I agree with your teacher, the algorithm will find all primes excepts 2 and 3 and some non-primes:
There are always 3 odd numbers between 6n and 6(n+1):
6n+1, 6n+3 and 6n+5 (=6(n+1)-1). 6n is divideable by 6, and because 3 is a prime factor of 6, 6n is also dividable by 3. The next number which is dividable by 3 is 6n+3 - it can''t be a prime. So only 6n+1 or 6n+5 could be primes and 6n+5 is the same as 6(n+1)-1.
I don''t know if this proof was given before, I didn''t read through the whole thread.

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA

This topic is closed to new replies.

Advertisement