How to Calculate a Prime Number

104 10

    The Long Way

    • 1). Enter a number into your calculator.

    • 2). Divide that number by every whole number between two and one less than your selected number.

    • 3). Stop when your quotient is a whole number. If you get a whole number for any division operation performed on a number between two and one less than your chosen number, your number is not prime.

    Trial Division

    • 1). Enter a number into your calculator.

    • 2). Find the square root of your number. If your square root is a whole number, your number is not prime.

    • 3). Divide your number by all the prime numbers between two and the value of your square root to the left of the decimal. This method greatly reduces the number of calculations required.

    Eratosthenes' Sieve

    • 1). Write a list of odd numbers, starting with three and continuing up to your selected number. Even numbers cannot be prime since they are all divisible by two.

    • 2). Cross out every multiple of three (3, 6, 9, 12...).

    • 3). Cross out every multiple of five (5, 10, 15, 20...). Continue this process with subsequent primes until your target number is crossed out or you reach a value greater than the square root of your target number.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.