Current location - Training Enrollment Network - Mathematics courses - How to judge whether a number is a prime number by mathematical methods
How to judge whether a number is a prime number by mathematical methods
Method 1: When judging whether the natural number A is a prime number by trial and error, divide A by each prime number in turn from small to large. If a prime number is divisible, it can be judged that this A is not a prime number; If it is not divisible, when the incomplete quotient is less than this prime number, there is no need to continue division, and it can be concluded that A must be a prime number.

Method 2: As long as X is the square difference between odd and even numbers (this is certain), a2-b2=(a+b)(a-b) are two factors.

For example, 2634 1, first find an even square number greater than 2634 1, 26896, and the difference between it and it is 555, which is definitely not a square number, and then the next square number (actually considering (x+1) 2 = x2+2x+/kloc-0). Then the difference between bit 28224 and 1 is 3, which is directly excluded, and the next 2559 does not (it is equal to 50 2+59 at a glance). If the next difference is 3, it will be discharged directly, and then the next one, the next one ... will find out the law quickly, and finally 2212 = 48841,48841-26341= 22500, which is obviously 22.