Primality Testing Number Theory


Test case 0 is giving error, kindly check

@duttrohan0302
miller rabin may say that the number is prime, but it may be prime. These are probabilistic test.And they can create false negatives.
If you need 100 score. Fermat primality test gives accurate result in these test cases, but these are just based on luck I guess. There will be cases where these tests may give false negatives.
Here is the code for fermat primality

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.