How to check if number is prime? For example $733$ with trial division test it gives from $2$ to $27$ (because $\sqrt733$ is approx $27$) it has no sense to divide by 2 to 27 i.e $733 \div 2 \ 733 \div 3 \ldots$. Are there any other solution?
Prime number test
-
1If you know some divisibility criteria, you can test with the number and see what happens. This way you can begin to doubt if the number is prime or not. – 2017-02-20
-
0There are a lot of little tests you can do to eliminate that number as not prime, but unfortunately, there is no easy/ not computationally intensive prime test that we know of. – 2017-02-20
-
1You only need to check for divisibility by small primes. $2,3,5,7,11,13,17,19,23$ – 2017-02-20
-
0What do you mean by "sick"? – 2017-02-20
-
0sick I mean frustrating and with no sense example what if I have bigger number i.e $12113$ https://www.wolframalpha.com/input/?i=12113+prime%3F is prime but how can I check without wolfram alfa (on test using Internet is disallow). Divide by $2$ to $110$ or $13$ is prime so the number is prime? – 2017-02-20
1 Answers
You only need to check for divisibility by primes, and there are only $9$ of those in range for $733$.
$2 \nmid 733$ - obvious.
$3 \nmid 733$ - digit-sum test.
$5 \nmid 733$ - obvious.
$7 \nmid 733$ - since $7 \nmid 33$.
$11 \nmid 733$ - since $11 \nmid 700$.
$13$: division needed $733 \div 13 = 56 \text{ r }5 $
$17$: division needed $733 \div 17 = 43 \text{ r }2 $
$19$: division needed $733 \div 19 = 38 \text{ r }11 $ (actually I worked down from $760$)
$23$: division needed $733 \div 23 = 31 \text{ r }20 $
and $29^2>733 \implies 733$ is prime.
Generally if you understand how these work, the actual calculation can be done using a computer for larger numbers - but trial division is not the way to go for seriously big numbers of course. Primality testing is a whole field of investigation.
-
3if you had to do the calculations by hand, you can bypass all the division via slightly simpler ad hoc observations: e.g., $720$ is obviously not divisible of $13$ so that $733$ isn't divisible by $13$ either. – 2017-02-20
-
3True, similarly $750$ is not divisible by $17$ – 2017-02-20
-
1And finally $710$ is not divisible by $23$, so we've done the lot without doing any divisions! – 2017-02-20