The wonders of prime numbers

People often come across diverse prime number problems, such as Finding largest prime factor of a number or finding all primes between two values. A prime number is a whole number greater than 1 that can only be divisible by itself and 1. It is obvious that prime numbers are different from other numbers because of it several applications in the real world.

Questions like this "find the ten digit prime number  having highest number of fives in it" may throw you of course a bit, after seeing such questions you often wonder "How many prime number exist", "what is the fastest way to generate a continuous stream of prime numbers" etc.

There have been several problems and several solutions on prime numbers. This part of mathematics is not a joke, Many questions regarding prime numbers remain open, such as Goldbach's conjecture (that every even integer greater than 2 can be expressed as the sum of two primes), and the twin prime conjecture (that there are infinitely many pairs of primes whose difference is 2). Such questions spurred the development of various branches of number theory, focusing on analytic or algebraic aspects of numbers. people have even studied just prime numbers as a profession, this is to show the extent at which its relevant.



The applications of prime numbers in computing can not be quantified, from cryptography to various generalizations functions. As a computer scientist the deep knowledge of prime number will be required when working on project such as encryption, special generators functions etc. If you are a computer scientist or programmer without fundamental knowledge of prime numbers, then you should go and study a book on it after this post.

Here is one of the provoking problems you will encounter, "The product of a 3 digit palindrome and 13379872 is an exciting 10 digit number, which is also a palindrome. one less than this number is the product of 5 and 6 digit prime numbers. find the palindrome and the prime factors". you should give it a try.

Note:

  • 2(Two) is the only even prime number
  • when testing if a number n is prime, only divide to square root of n
Subsequent post will discuss on several methods of generating prime numbers
For programming problems on prime numbers check https://projecteuler.net/archives