Is 2 a prime? The answer, to a mathematician, is contingent; it depends on what system of numbers you're working with. More under the cut.
For the duration, I'm going to use the phrase "number system". It's not a technical term, but I need a phrase for a certain concept. So here's the definition we're going to use. A number system is a subset of the complex numbers, which contains 0 and 1, and also contains the sum, difference, and product of any two of its members. The smallest number system is Z, the set of all whole numbers, positive or negative. Other familiar number systems are Q, the rational numbers; R, the real numbers; and C, the complex numbers. A less familiar example is the set of Gaussian integers, Z[i], which consists of numbers m+ni, where m and n are integers. (You can define Q[i] similarly; R[i] = C.) More generally, if N is a number system and a is a complex number, N[a] is the smallest number system containing N and a. (We speak of "taking N and throwing in a".) Z[Sqrt[2]] is the set of numbers m+n Sqrt[2], where m and n are integers; if a is the real cube root of 2, Z[a] includes the numbers m+na+ra2; and so on.
Now, in any number system, we have various special classes of numbers. 0 is always in a class by itself. The units are the numbers in the system whose reciprocals are also in the system. In Z, the only units are 1 and -1; in Q, everything except 0 is a unit; in Z[i], the units are 1, -1, i, and -i. A number is irreducible if it is neither 0 nor a unit and, when we write it as a product (of numbers in the system), one of the factors must be a unit. 2 is irreducible in Z, but not in Z[i]: 2 = (1+i)(1-i). A stronger condition is for a number to be prime; a number is prime if it is neither 0 nor a unit and, whenever it divides a product, it divides one of the factors. In Z (and in Z[i]), every irreducible is prime, but it turns out that in some number systems, there are irreducibles which are not prime. A number which is neither 0, a unit, nor prime is composite.
This is just a warm-up; next time, I'll look at various specific number systems and their collections of primes, irreducibles, and what not.
For the duration, I'm going to use the phrase "number system". It's not a technical term, but I need a phrase for a certain concept. So here's the definition we're going to use. A number system is a subset of the complex numbers, which contains 0 and 1, and also contains the sum, difference, and product of any two of its members. The smallest number system is Z, the set of all whole numbers, positive or negative. Other familiar number systems are Q, the rational numbers; R, the real numbers; and C, the complex numbers. A less familiar example is the set of Gaussian integers, Z[i], which consists of numbers m+ni, where m and n are integers. (You can define Q[i] similarly; R[i] = C.) More generally, if N is a number system and a is a complex number, N[a] is the smallest number system containing N and a. (We speak of "taking N and throwing in a".) Z[Sqrt[2]] is the set of numbers m+n Sqrt[2], where m and n are integers; if a is the real cube root of 2, Z[a] includes the numbers m+na+ra2; and so on.
Now, in any number system, we have various special classes of numbers. 0 is always in a class by itself. The units are the numbers in the system whose reciprocals are also in the system. In Z, the only units are 1 and -1; in Q, everything except 0 is a unit; in Z[i], the units are 1, -1, i, and -i. A number is irreducible if it is neither 0 nor a unit and, when we write it as a product (of numbers in the system), one of the factors must be a unit. 2 is irreducible in Z, but not in Z[i]: 2 = (1+i)(1-i). A stronger condition is for a number to be prime; a number is prime if it is neither 0 nor a unit and, whenever it divides a product, it divides one of the factors. In Z (and in Z[i]), every irreducible is prime, but it turns out that in some number systems, there are irreducibles which are not prime. A number which is neither 0, a unit, nor prime is composite.
This is just a warm-up; next time, I'll look at various specific number systems and their collections of primes, irreducibles, and what not.