Best Answer

Suppose you want to find out if a number P is prime. For small P the method is simple:

You try to divide P by 2, then 3 and then by the next prime number until you reach sqrt(P). If any one of these primes divides P without remainder then P is not a prime, and if you have still not found a factor after trying sqrt(P) then P is a prime.

So far it is simple. The problem is that this method becomes quite time consuming for large P so that it is not a practical method for determining the primality of large numbers. There are methods, but you do need to know advanced mathematics. Follow the attached link if you think that you are up to it.

Q: What steps would you determine whether a number is prime?

Write your answer...

Submit

Still have questions?

Continue Learning about Math & Arithmetic

While there are many ways to determine whether a number is prime or composite, there are easy ways to check numbers up to 100:Try factoring the number. A prime numbers has exactly two factors, 1 and the number itself, and a composite number has one or more factors in addition to 1 and the number itself.All numbers greater than 2 and less than 49 are composites if they are even numbers, if they are multiples of 3, or if they end in 5 or 0.Composite numbers 8 to 100 include the above and all numbers divisible by 7.Test larger numbers by trial division by larger primes that are less than the square root of the number.

It's more efficient. You want to end up with all prime numbers. You could divide by a composite number, but you'd just have to break that number down later. It saves steps.

Algorithm: to generate all prime numbers between the limits l1 and l2.Input: l1 and l2Output: Prime numbers between l1 and l2Method:for (n=l1 to l2 in steps of 1 do)prime=truefor (i=2 to n/2 in steps of 1 do)if (n % i =0)prime = falsebreakend_ifend_forif (prime = true)Display 'Prime number is =', nend_for

Since 62 is even, divide by 2. Since the result is prime, stop. 2 x 31 = 62

First you try to solve it, but you will soon realize that there is only two steps. Guess and Check.

Related questions

No, it is a prime number.

cuz it is

While there are many ways to determine whether a number is prime or composite, there are easy ways to check numbers up to 100:Try factoring the number. A prime numbers has exactly two factors, 1 and the number itself, and a composite number has one or more factors in addition to 1 and the number itself.All numbers greater than 2 and less than 49 are composites if they are even numbers, if they are multiples of 3, or if they end in 5 or 0.Composite numbers 8 to 100 include the above and all numbers divisible by 7.Test larger numbers by trial division by larger primes that are less than the square root of the number.

collection of the facts to determine whether injustices exist;negotiation;self-purificationdirect action

It's more efficient. You want to end up with all prime numbers. You could divide by a composite number, but you'd just have to break that number down later. It saves steps.

Algorithm: to generate all prime numbers between the limits l1 and l2.Input: l1 and l2Output: Prime numbers between l1 and l2Method:for (n=l1 to l2 in steps of 1 do)prime=truefor (i=2 to n/2 in steps of 1 do)if (n % i =0)prime = falsebreakend_ifend_forif (prime = true)Display 'Prime number is =', nend_for

Since 62 is even, divide by 2. Since the result is prime, stop. 2 x 31 = 62

First you try to solve it, but you will soon realize that there is only two steps. Guess and Check.

It's a certain number of steps that determine and egg, so just walk or run alot.

It depends on whether the "15" is a vector or a scalar. If it is a scalar then it indicates 15 steps in any direction. Only if it is a vector is the direction specified and then, 15 is the same number of steps in the opposite direction.

Start with 2. Attempt to divide the number by 2. If it goes evenly, try again. Count the number of times 2 goes into the number. Repeat with 3, and then 5, 7, 11, etc., i.e. all the primes until the prime you are trying is greater than the square root of the number.

There are flowcharts available for computers, that depend upon brute number crunching. In other words, they are dividing a given number by every lesser number and seeing if there are any that divide evenly into it. For humans, this is a bit harder. However, here are four steps to let you know if a number can be divided by the numbers 1 through 9 (but not seven). 1. Is it an even number? If yes, then stop, it's not prime. 2. Is it a number ending in zero or five? If yes, then stop, it's not a prime. 3. Do the digits in the number add up to three or nine? If yes, then stop, it's not a prime. Now, any "yes" answer ends it. But if all the above were answered "no", that doesn't actually end it. Maybe the number can be divided by 7. Or 11. Or even larger numbers.