• Create Account

### #ActualOlof Hedman

Posted 25 October 2012 - 11:08 AM

memory allocation isn't the problem, since that extra memory will never be used, will just sit there.
The problem is that there is so far between the big primes, and you test way too many numbers.
You could cut it in half if you only test odd numbers... (i+=2) but there is probably smarter ways...

But even better, since prime numbers never change, why not precalculate them once, save to file, and then load the prime table from file instead?

### #7Olof Hedman

Posted 25 October 2012 - 11:07 AM

memory allocation isn't the problem, since that extra memory will never be used, will just sit there.
The problem is that there is so far between the big primes, and you test way too many numbers.
You could cut it in half if you only test odd numbers... (i+=2) but there is probably smarter ways...

But even better, since prime numbers never change, why not precalculate them once, save to file, and then load them from file?

### #6Olof Hedman

Posted 25 October 2012 - 11:07 AM

memory allocation isn't the problem, since that extra memory will never be used, will just sit there.
The problem is that there is so far between the big primes, and you test way too many numbers.
You could cut it in half if you only test odd numbers... (i+=2) but there is probably smarter ways...

But even better, since they prime numbers never change, why not precalculate them once, save to file, and then load them from file?

### #5Olof Hedman

Posted 25 October 2012 - 11:06 AM

memory allocation isn't the problem, since that extra memory will never be used, will just sit there.
The problem is that there is so far between the big primes, and you test way too many numbers.
You could cut it in half if you only test odd numbers... (i+=2) but there is probably smarter ways...

But even better, since they prime numbers never change, why not precalculate them once, and then load them from file?

### #4Olof Hedman

Posted 25 October 2012 - 11:06 AM

memory allocation isn't the problem, since that extra memory will never be used, will just sit there.
The problem is that there is so far between the big primes, and you test way too many numbers.
You could cut it in half if you only test odd numbers... (i+=2) but there is probably smarter ways...

### #3Olof Hedman

Posted 25 October 2012 - 11:05 AM

memory allocation isn't the problem, since that extra memory will never be used, will just sit there.
The problem is that there is so far between the big primes, and you test way to many numbers.
You could cut it in half if you only test odd numbers... (i+=2) but there is probably smarter ways...

PARTNERS