Showing posts with label Prime Number. Show all posts
Showing posts with label Prime Number. Show all posts

Monday, April 8, 2013

Prime Numbers Math

Introduction to Math prime numbers:

In mathematics, a prime number (or a prime) is a natural number that has exactly two distinct natural number divisors: 1 and itself. The first twenty-five prime numbers are:

Prime Numbers:- 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.

Condition: - If x is the prime number then the next factors of the number x is 1 and X.(Source:Wikipidea)


Prime numbers in math:


To finding a prime number up to hundred is very easy. Suppose we need to find above 100 means it is just difficult. So let us follow the short cut method.

For example:
Authenticate if 149 is prime number.

Step 1:

Now we have to take Square root for 149 = 12.20
Now rounding the value 12.20 to the nearest big whole number. We can write 12.20 as 13.

Step 2:

Then find the Prime Numbers below 13. The factors up to 13 are 2, 3, 5, 7, 11 and 13.

Step 3:
The given number 149 is not divisible by 2, 3, 5, 7, 11 and 13.
So the number 149 is considered as prime number.

I have recently faced lot of problem while learning Prime Number Formula, But thank to online resources of math which helped me to learn myself easily on net.

Example problems for math prime number:


Problem 1:

Find the number 71 is prime number or not?

Solution:

The given number 71 is a prime number. Why means it includes two factors 1 and 71 only. So the given number 71 is a prime number.

Problem 2:

Find the number 101 is prime number or not?

Solution;

The given number 101 is divisible by one and itself only. So it is called as prime number.

Problem 3:

Work out the number 39 is prime number or not?

Solution:

The given number 39 includes more than 2 factors. This is 1, 6, 13 and then 39. Thus the given number 39 is not a prime number.

Problem 4:

Work out the number 434 is prime number or not?

Solution;

The given number 434 includes more than 2 factors. This is 1, 2, 7, 31, 217, and then 434. Thus the given number 434 is not a prime number.

Problem: - 5

Work out the number 638 is prime or not?

Solution:

The given number is 638 divided by 2. So the factors for 638 are 1, 2, 11, 29,    319 and 638. Thus the number is not a prime number.

Practice problem for math prime numbers:

Problem 1:

Find the number 97 is prime or not?

Solution:

The given number 97 is a prime number.

Problem 2:

Find the number 178 is prime or not?

Solution:

The given number 178 is not a prime number.

Tuesday, October 16, 2012

Prime Number Algorithm

Introduction to prime number algorithm:

A prime number is a positive natural number with no other divisors except one and itself but the number 1 is excluded by definition. That is to say one is not a prime number. That leaves us with the first prime number as 2  and it is quite obvious that all other prime numbers after 2 have to be odd numbers only. The concept of prime numbers has fascinated mathematicians from the earliest times. Euclid proved infinitude of prime numbers as early as 300 B.C. There have been many failed attempts to find a formula that will generate prime numbers. A search for efficient algorithms to find prime numbers gained momentum with the advent of computers and today many efficient programs exist to calculate prime numbers limited only by the processor memory and speed.

Finding Prime Numbers by Division:

In order to check whether a given number n is a prime or not, it has to be divided one by one by all prime numbers less than `sqrt(n)`. The reasoning is simple; if the number is not a prime then there will be at least one prime factor which is less than  `sqrt(n)`. This can be used to create a simple algorithm for checkng numbers one by one and discarding compound numbers will leave a list of prime numbers.

In simple language we can write the algorithm as:

Take numbers 2 to N (one by one). Let the number by x

Divide x by all prime numbers less than or equal to `sqrt(x)`

If it is divisible by any of the prime numbers, discard it as non-prime and go to next number.

Simple! Isn't it? But it is not a very useful algorithm for use with computers, where too much processor is lost in division operation at every stage of this algorithm. Processors are more comfortable with read and write commands and simple addition and substraction operations. It is interesting to note that one of the oldest algorithms Sieve of Eratosthenes is one of the efficient algorithms for use with modern computers.

Between, if you have problem on these topics Numerical Expression Examples, please browse expert math related websites for more help on Calculating Profit Percentage.

Sieve of Eratosthenes of Prime Number Algorithm:

Concept behind this prime number algorithm is quite simple and uses tool of skip counting learnt by all of us in elementary school. It has only two steps. Write all the numbers up to a specified number. 2 is a prime, so after 2 strike out every second number. Next is 3 again a prime, so after 3 strike out every third number; and so on. Every time you complete the process for a prime p, you would be left with only primes up to the number p2.

Step 1:

2,  3,  4,  5,  6,  7,  8,  9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25

Step 2: Striking out every second, then every third and then every fifth number, we are left with prime numbers less than 52 = 25 (shown in bold).

2,  3,  4,  5,  6,  7,  8,  9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25

We are left with prime numbers up to 25 as: 2, 3, 5, 7, 11, 13, 17, 19, 23.

It is interesting to note that this algorithm is found quite suitable for listing prime numbers using present day computing devices.