The correct method would be to give a database the job. It would need some initial programming but would be more efficient long term. It would also allow for through checking of bases by storing all primes n>=1(This would require a lot of disk space for bases like R3 but disk space is cheep.)
|