Simple definition of a prime number: A number that is only divisible by one and by itself. By definition 1 isn't prime. Here is a brute force algorithm to determine if a number is prime or not.
boolean isPrime(int n)
{
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}