Prime Numbers are natural numbers greater than 1 and can be divided by itself and 1 only. For instance, numbers 2, 3, 5, 7, and 11 are the prime numbers since they can only be divided by 1 and themselves, there is no other number that can fully divide them Since it is manually very difficult to check if a number is prime (no direct formula) and find prime factors, problems related to prime become really interesting coding problems.
Here is a list of example problems based on prime.
- Check for Prime Number
- All Prime Factors
- Largest Prime Factor
- Check for Co-Prime
- Primes in an Array
- Primes with Given Sum
- Pair of Primes with Given Sum and Min Diff
- Prime Number Gap
- Find the next prime
- Check for Strong Prime
- Closest Prime
- N Digit Numbers with Prime Digits
- Sieve of Eratosthenes
- Nth Prime Number
- Program to print prime numbers from 1 to N.
- Segmented Sieve
Recommended Links