Just for curiosity, I wanted to see how fast my computer can calculate prime numbers. I'm planning to write the program in java and use threads to speed up the process. The only problem I'm facing is the fact that it'll be working with very large numbers, much larger than 2^64. I've heard of the BigInteger class but I'm very unfamiliar with it. I don't know how to implement it in the code and use simple algebraic calculations with it. If you have some suggestions on how to use BigInteger I would be very pleased if you could help.
Anyways, the program will work by calculating a number using the Mersenne form 2^x - 1 inside an infinite loop. Then at every cycle the number will be then verified if it is prime or not. The prime number will be printed on the console. That's it.
I'm probably gonna write two programs which do the same thing one with threading and the other without just to see the differences.
Anyways, the program will work by calculating a number using the Mersenne form 2^x - 1 inside an infinite loop. Then at every cycle the number will be then verified if it is prime or not. The prime number will be printed on the console. That's it.
I'm probably gonna write two programs which do the same thing one with threading and the other without just to see the differences.
Last edited: