How can I tell if a number is a prime number?

How can I tell if a number is a prime number?
In mathematics, a prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. To determine if a number is prime, you can use the following method:
-
Trial Division: Check if the number is divisible by any number other than 1 and itself. If not, it's a prime number.
-
Sieve of Eratosthenes: This method generates all prime numbers up to a specified number and determines if the given number is present in the list.
Using these techniques, you can identify prime numbers and enhance your understanding of number theory.