Problem with memory in program generating primes

I have a problem with my primes generator. It generates primes and write each one into a file. When I use unsigned long int for all calculations, the biggest prime I got is 523763, then program falls. But it doesn't fall due to cpu or huge memory usage. My algorithm is as fast while counting huge primes as counting small numbers. I thought that my problem is caused by unsigned long int, so I decided to use GMP library (library for huge numbers). I wrote everything well, there are no bugs in my code. Unfortunately, now it stopps on 52817. How it's possible ??!! I changed all unsigned long ints into gmp class, so I don't know what to do.....
closed account (z05DSL3A)
I’ll just check my crystal ball…oh dear, the batteries are flat.
If you post your code, we can look over it for bugs.
Topic archived. No new replies allowed.