All square numbers have odd number of factors. All other numbers have even number of factors.
To check whether a number is prime, it is sufficient to check its divisibiliy by all prime numbers less than square root of the number.
A number n is a sum of two squares if and only if all prime factors of n of the form 4m+3 have even exponent in the prime factorization of n.
if p is a prime number, then for any integer a, ap ? a will be evenly divisible by p. This can be expressed in the notation of modular arithmetic as follows. ap ? a (mod p) . This is Fermat’s Little Theorem.
If an integer n is greater than 2, then the equation an + bn = cn has no solutions in non-zero integers a, b, and c. This is Fermat’s Last Theorem.