Friday, September 19, 2008

Prime Number

Prime number is a one which is not divisible by any other number expect one.
Given a number, to find whether it is prime or not,the process of checking whether it is divisble by any other number is time consuming and tedious. There is a simple alternative solution for this. All prime numbers satisfy the following condition.
If n is prime,
(n-1)! is congruent to (n-1)mod n.
Let us take an example. Take n=7.
(n-1)!=6!=720.
720 is congruent to 6 mod 7.
Therefore, 7 is a prime number.

putta

1 comment:

Vignesh C said...

Putta! Budding Einstein! Nee solradhukku munnadi naanae soltaen! Poadhuma? ;)