# Thread: whether number is prime or not

1. Yes,i think i would have go with GMP.............

please suggest me other solution of my problem ....

2. If you are going to use GMP, I recommend you use C++. The C interface to GMP is... irritating. With the C++ interface, they have overladed operators and other niceties impossible in C. I also forgot to mention that iMalc's library is in C++, with no C interface, AFAIK.

3. Thn x "CommonTater".......
On linux system it gives warning message while on windows system it gives error message when i was using GCC but with VC++ compiler it's all fine .

Thanx evry1 :-)

4. You could try to type your constant...
Code:
unsigned long long x = 600851475143LL;

You could try to type your constant...
Code:
unsigned long long x = 600851475143LL;
I'm surprised that after this many posts nobody outright knew that you simply cannot enter a constant larger than 2^32-1 without specifying a type suffix.
In this case I would use ULL though since you're assigning to an Unsigned Long Long.

If you want to do primality tests for numbers between 2^32 and 2^64, try using the deterministic version of the Miller Rabin test with the first 13 primes.

6. Originally Posted by iMalc
If you want to do primality tests for numbers between 2^32 and 2^64, try using the deterministic version of the Miller Rabin test with the first 13 primes.
So I read somewhere that the "absolute" theoretical limit is 2*ln(N)^2; for a 64-bit number, that would equate to trying bases below 3935. But then the maximum is apparently much lower than that (according to Pomerance, Selfridge, et al). I wonder why there is such a huge gap between the two?

7. Originally Posted by Sebastiani
So I read somewhere that the "absolute" theoretical limit is 2*ln(N)^2; for a 64-bit number, that would equate to trying bases below 3935. But then the maximum is apparently much lower than that (according to Pomerance, Selfridge, et al). I wonder why there is such a huge gap between the two?
I've been wondering that for a little while myself.
I think it must be that the theory was enough to prove that 2ln(n) was sufficient, but in practice less is fine, but no even lower bound has been proven yet.

I'm busy trying to implement the BPSW test myself. Just have the actual Lucas pseudoprime test left to get working.

8. Originally Posted by iMalc
I've been wondering that for a little while myself.
I think it must be that the theory was enough to prove that 2ln(n) was sufficient, but in practice less is fine, but no even lower bound has been proven yet.

I'm busy trying to implement the BPSW test myself. Just have the actual Lucas pseudoprime test left to get working.
Hmm...the BPSW sounds even more interesting still. No counterexamples to date? Wow!