Hard Light Productions Forums

Off-Topic Discussion => General Discussion => Topic started by: Primus on March 04, 2005, 11:01:36 am

Title: Longest prime number
Post by: Primus on March 04, 2005, 11:01:36 am
http://www.guardian.co.uk/life/news/story/0,12976,1428429,00.html

Isn't it great? I'm asking because I don't know and math is something that gives me a headache.

So, the longest prime number was discovered.. What now?
Title: Longest prime number
Post by: aldo_14 on March 04, 2005, 11:07:07 am
Now they find a bigger one.

I have to admit, I'm not entirely sure how important it is to find an 8 million digit prime.....
Title: Longest prime number
Post by: karajorma on March 04, 2005, 11:30:31 am
Well you could use it to make one hell of a unique hash code :D
Title: Longest prime number
Post by: phreak on March 04, 2005, 11:31:57 am
indeed
Title: Re: Longest prime number
Post by: Col. Fishguts on March 04, 2005, 12:28:02 pm
Quote
Originally posted by Primus
So, the longest prime number was discovered.. What now?


There is no biggest prime number.
The set of primes is infinite, which was shown by Euclid in of the most elegant pieces of pure mathematical reasoning.

But yes...big prime numbers are useful for kryptographic methods.
Title: Longest prime number
Post by: Petrarch of the VBB on March 04, 2005, 02:34:10 pm
http://members.surfeu.fi/kklaine/primebear.html
Title: Longest prime number
Post by: Primus on March 04, 2005, 03:12:02 pm
:lol: That explains everything!
Title: Longest prime number
Post by: KappaWing on March 04, 2005, 04:32:29 pm
Quote

So, the longest prime number was discovered.. What now?


Sounds to me like this eye specialist has far too much time on his hands. But still, a semi-important discovery. :rolleyes:
Title: Longest prime number
Post by: Kie99 on March 04, 2005, 05:23:25 pm
Maybe someone will work out Pi
Title: Longest prime number
Post by: WMCoolmon on March 04, 2005, 06:27:53 pm
#undef Pi
#define Pi 3.141592654f

There. :p
Title: Longest prime number
Post by: WMCoolmon on March 04, 2005, 06:51:15 pm
Just for fun, I wrote a program that will calculate all prime numbers up to...*checks* 18446744073709551615.

Anyone want it? :p
Title: Longest prime number
Post by: Primus on March 04, 2005, 07:07:16 pm
Quote
Originally posted by WMCoolmon
Just for fun, I wrote a program that will calculate all prime numbers up to...*checks* 18446744073709551615.

Anyone want it? :p


You need help.

;)
Title: Longest prime number
Post by: Ford Prefect on March 04, 2005, 07:04:34 pm
Maybe I'm missing something, (which is entirely possible, seeing as my brain takes math the same way a microwave takes a fork), but if numbers are infinite, how can there be a highest prime number?
Title: Longest prime number
Post by: Ghostavo on March 04, 2005, 07:10:32 pm
Quote
Originally posted by Ford Prefect
Maybe I'm missing something, (which is entirely possible, seeing as my brain takes math the same way a microwave takes a fork), but if numbers are infinite, how can there be a highest prime number?


Quote
Originally posted by Col. Fishguts
There is no biggest prime number.
The set of primes is infinite, which was shown by Euclid in of the most elegant pieces of pure mathematical reasoning.
Title: Longest prime number
Post by: Ford Prefect on March 04, 2005, 07:13:15 pm
Yeah I saw that, but why did we need elegant mathematical reasoning to figure out that there's no largest prime number? Doesn't it just sort of... stand to reason?
Title: Longest prime number
Post by: Primus on March 04, 2005, 07:20:39 pm
Quote
Originally posted by Ford Prefect
but if numbers are infinite, how can there be a highest prime number?


Because, prime number can only be divided by themselves and 1, and at some point it.. It cannot... Be done?

Why did I try to answer that? I have no idea!
Title: Longest prime number
Post by: WMCoolmon on March 04, 2005, 07:16:20 pm
Quote
Originally posted by Primus


You need help.

;)


It inflates my ego to only have to compile something three times before all the bugs are worked out of it. :p

Code: [Select]
#define UINT64_MAX 18446744073709551615
#include
#include
#include

std::vector Primes;

bool nonstoploop()
{
unsigned __int64 x = 2;
unsigned __int64 y = 0;
bool Prime;

while(x != UINT64_MAX)
{
Prime = true;
for(y = 2; y < x; y++)
{
if(x % y == 0)
{
Prime = false;
break;
}
}

if(Prime)
Primes.push_back(x);
x++;
}

return true;
}

bool stoppableloop()
{
unsigned __int64 x = 2;
unsigned __int64 y = 0;
bool Prime;
int k;

while(x != UINT64_MAX)
{
Prime = true;
x++;
for(y = 2; y < x; y++)
{
if(x % y == 0)
{
Prime = false;
break;
}
}

if(Prime)
Primes.push_back(x);

k = getch();
if(k == 'q')
return false;
}
return true;
}

int main(int argc, char** argv)
{
bool wasted;
if(argc > 1)
wasted = stoppableloop();
else
wasted = nonstoploop();

size_t num = Primes.size(); //Hopefully this is big enough
for(unsigned __int64 i = 0; i < num; i++)
{
printf("Prime number: %d", Primes[i]);
}

if(wasted)
printf("Congratulations! You just wasted your time finding the highest prime number up to %d", UINT64_MAX);
else
printf("You wimped out. Clearly you aren't (wo)man enough to go all the way.");
}
Title: Longest prime number
Post by: Ghostavo on March 04, 2005, 07:16:13 pm
Because proof of something is better than belief in something? :p
Title: Longest prime number
Post by: Moonsword on March 04, 2005, 08:08:51 pm
Furthermore, why did you answer if you don't have a meaningful answer?  I have no idea.  Spammer.

To answer your question, Ford, yes it does... asuming that you know that there is no largest number.  Without that knowledge, the assumption is groundless.  My field isn't the history mathematics but I would imagine that 'infinity' wasn't always a concept that humanity was familiar with.
Title: Longest prime number
Post by: Grey Wolf on March 04, 2005, 08:15:27 pm
Given that they weren't always familiar with zero, that's a fairly good guess Moonsword.
Title: Longest prime number
Post by: Grug on March 06, 2005, 01:54:12 am
OMG.

I thought I'd escaped it. Friend of mine is seeing how high his program will go in calculating the Prime numbers...

I'm surrounded by the fools... :(
This same friend of mine, at one point had pi memorized upto 100 decimal places. I only got upto 25 or something. Man was I bored back then...

btw.
Quote
#define Pi 3.141592654f

Is incorrect, its rounded up. If thats what the f means then meh.
From memory:
3.14159265358979 ...meh the rest.

Pi used to be on an exceptionally large poster going around the class room wall near the roof. When bored, I just sat there memorizing pi, till I discovered that there were better things to look at, such as the developing young woman around me... :)