Naturally, for bool isprime(number)
there would be a data structure I could query.
I define the best algorithm, to be the algorithm that pr
There are many ways to do the primality test.
There isn't really a data structure for you to query. If you have lots of numbers to test, you should probably run a probabilistic test since those are faster, and then follow it up with a deterministic test to make sure the number is prime.
You should know that the math behind the fastest algorithms is not for the faint of heart.