rainmaker wrote:Hi all,
What is the fastest way to determine if a number is prime? I see some questions in which you need to check if a number is prime or not. The problem is sometimes the number is a huge number.
Thanks
Basically,you have to memorize some divisibility rules of prime no.s .
1:check if even or not.[divisible by 2]
2:check if sum of digits is divisible by 3. [ divisible by 3]
3:check if the no. ends with a 5 or 0. [divisible by 5]
Similarly,you have to remember the rules for 7,11,13,17,19 which can be quite complicated.
I think this link will help you:-
https://en.wikipedia.org/wiki/Divisibility_rule
Just keep in mind that you learn them.
[Personally I don't think you will need to know for above than 19 e.g:-23,29 etc.]
Further ,if you have any doubt you can post in this thread afterwards.

It takes time and effort to explain, so if my comment helped you please press Thanks button
Just because something is hard doesn't mean you shouldn't try,it means you should just try harder.
"Keep Walking" - Johnny Walker
