If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

## Pre-algebra

### Course: Pre-algebra>Unit 1

Lesson 2: Prime and composite numbers

# Prime numbers

Prime numbers are numbers that have only 2 factors: 1 and themselves. For example, the first 5 prime numbers are 2, 3, 5, 7, and 11. By contrast, numbers with more than 2 factors are call composite numbers. Created by Sal Khan.

## Want to join the conversation?

• Ate there any easy tricks to find prime numbers?
(154 votes)
• If you want an actual equation, the answer to your question is much more complex than the trouble is worth. There's an equation called the Riemann Zeta Function that is defined as The Infinite Series of the summation of 1/(n^s), where "s" is a complex variable (defined as a+bi). When the "a" part, or real part, of "s" is equal to 1/2, there arises a common problem in number theory, called the Riemann Hypothesis, which says that all of the non-trivial zeroes of the function lie on that real line 1/2. The distribution of the values directly relate to the amount of primes that there are beneath the value "n" in the function. This delves into complex analysis, in which there are graphs with four dimensions, where the fourth dimension is represented by the darkness of the color of the 3-D graph at its separate values. Like I said, not a very convenient method, but interesting none-the-less.
(104 votes)
• What is the harm in considering 1 a prime number? It is true that it is divisible by itself and that it is divisible by 1, why is the "exactly 2" rule so important?
(72 votes)
• The Fundamental Theorem of Arithmetic states that every number is either prime or is the product of a list of prime numbers, and that list is unique aside from the order the terms appear in. For instance, I might say that 24 = 3 x 2 x 2 x 2 and you might say 24 = 2 x 2 x 3 x 2, but we each came up with three 2's and one 3 and nobody else could do differently. This wouldn't be true if we considered 1 to be a prime number, because then someone else could say 24 = 3 x 2 x 2 x 2 x 1 and someone else could say 24 = 3 x 2 x 2 x 2 x 1 x 1 x 1 x 1 and so on, Sure, we could declare that 1 is a prime and then write an exception into the Fundamental Theorem of Arithmetic, but all in all it's less hassle to just say that 1 is neither prime nor composite.
(127 votes)
• why is 1 not prime?
(80 votes)
• In the 19th century some mathematicians did consider 1 to be prime, but mathemeticians have found that it causes many problems in mathematics, if you consider 1 to be prime. The most notable problem is The Fundamental Theorem of Arithmetic, which says any number greater than 1 has a unique prime factorization. e.g. 6= 2* 3, (2 and 3 being prime). But if we let 1 be prime we could write it as 6=1*2*3 or 6= 1*2 *1 *3. There would be an infinite number of ways we could write it. There are other issues, but this is probably the most well known issue.

So 1 is specifically excluded from being prime.
(114 votes)
• Why is 2 considered a prime number?
(56 votes)
• As Sal says at , it's a number divisible by only two natural numbers. And two is divisible by only 1 and 2. It does, as he mentions at , break the pattern of all the other primes in being the only even prime number.
(58 votes)
• Is pi prime or composite?
(22 votes)
• Neither - those terms only apply to integers (whole numbers) and pi is an irrational decimal number.
(78 votes)
• Why does a prime number have to be divisible by two natural numbers? Why can't it also be divisible by decimals?
(40 votes)
• All numbers are divisible by decimals. For example, you can divide 7 by 2 and get 3.5 . When using prime numbers and composite numbers, stick to whole numbers, because if you are factoring out a number like 9, you wouldn't say its prime factorization is 2 x 4.5, you'd say it was 3 x 3, because there is an endless number of decimals you could use to get a whole number.
(11 votes)
• Why is one not a prime number i don't understand?
(12 votes)
• I have question for you
Would consider 1 and 1 different numbers?
I wouldn’t. The mathematical community doesn’t either.
So when a number is divisible by itself and one, it’s prime asking the number itself isn’t one
I hope this helps you
(12 votes)
• At what does counter intuitive mean ?
(14 votes)
• It means that something is opposite of common-sense expectations but still true.Hope that helps! :)
(13 votes)
• bro why does my brain refuse to understand math
(15 votes)
• It is ok, just try to work harder.
(0 votes)
• what are natural numbers?
(6 votes)
• Good question for 4th grade! Natural numbers are positive whole numbers such as 1, 2, 3, 4, 5,... and so on forever. These are called counting numbers.

Sometimes 0 is also included in the natural numbers.

Have a blessed, wonderful day!
(17 votes)

## Video transcript

In this video, I want to talk a little bit about what it means to be a prime number. And what you'll see in this video, or you'll hopefully see in this video, is it's a pretty straightforward concept. But as you progress through your mathematical careers, you'll see that there's actually fairly sophisticated concepts that can be built on top of the idea of a prime number. And that includes the idea of cryptography. And maybe some of the encryption that your computer uses right now could be based on prime numbers. If you don't know what encryption means, you don't have to worry about it right now. You just need to know the prime numbers are pretty important. So I'll give you a definition. And the definition might be a little confusing, but when we see it with examples, it should hopefully be pretty straightforward. So a number is prime if it is a natural number-- and a natural number, once again, just as an example, these are like the numbers 1, 2, 3, so essentially the counting numbers starting at 1, or you could say the positive integers. It is a natural number divisible by exactly two numbers, or two other natural numbers. Actually I shouldn't say two other, I should say two natural numbers. So it's not two other natural numbers-- divisible by exactly two natural numbers. One of those numbers is itself, and the other one is one. Those are the two numbers that it is divisible by. And that's why I didn't want to say exactly two other natural numbers, because one of the numbers is itself. And if this doesn't make sense for you, let's just do some examples here, and let's figure out if some numbers are prime or not. So let's start with the smallest natural number-- the number 1. So you might say, look, 1 is divisible by 1 and it is divisible by itself. You might say, hey, 1 is a prime number. But remember, part of our definition-- it needs to be divisible by exactly two natural numbers. 1 is divisible by only one natural number-- only by 1. So 1, although it might be a little counter intuitive is not prime. Let's move on to 2. So 2 is divisible by 1 and by 2 and not by any other natural numbers. So it seems to meet our constraint. It's divisible by exactly two natural numbers-- itself, that's 2 right there, and 1. So 2 is prime. And I'll circle the prime numbers. I'll circle them. Well actually, let me do it in a different color, since I already used that color for the-- I'll just circle them. I'll circle the numbers that are prime. And 2 is interesting because it is the only even number that is prime. If you think about it, any other even number is also going to be divisible by 2, above and beyond 1 and itself. So it won't be prime. We'll think about that more in future videos. Let's try out 3. Well, 3 is definitely divisible by 1 and 3. And it's really not divisible by anything in between. It's not divisible by 2, so 3 is also a prime number. Let's try 4. I'll switch to another color here. Let's try 4. Well, 4 is definitely divisible by 1 and 4. But it's also divisible by 2. 2 times 2 is 4. It's also divisible by 2. So it's divisible by three natural numbers-- 1, 2, and 4. So it does not meet our constraints for being prime. Let's try out 5. So 5 is definitely divisible by 1. It's not divisible by 2. It's not divisible by 3. It's not exactly divisible by 4. You could divide them into it, but you would get a remainder. But it is exactly divisible by 5, obviously. So once again, it's divisible by exactly two natural numbers-- 1 and 5. So, once again, 5 is prime. Let's keep going, just so that we see if there's any kind of a pattern here. And then maybe I'll try a really hard one that tends to trip people up. So let's try the number. 6. It is divisible by 1. It is divisible by 2. It is divisible by 3. Not 4 or 5, but it is divisible by 6. So it has four natural number factors. I guess you could say it that way. And so it does not have exactly two numbers that it is divisible by. It has four, so it is not prime. Let's move on to 7. 7 is divisible by 1, not 2, not 3, not 4, not 5, not 6. But it's also divisible by 7. So 7 is prime. I think you get the general idea here. How many natural numbers-- numbers like 1, 2, 3, 4, 5, the numbers that you learned when you were two years old, not including 0, not including negative numbers, not including fractions and irrational numbers and decimals and all the rest, just regular counting positive numbers. If you have only two of them, if you're only divisible by yourself and one, then you are prime. And the way I think about it-- if we don't think about the special case of 1, prime numbers are kind of these building blocks of numbers. You can't break them down anymore they're almost like the atoms-- if you think about what an atom is, or what people thought atoms were when they first-- they thought it was kind of the thing that you couldn't divide anymore. We now know that you could divide atoms and, actually, if you do, you might create a nuclear explosion. But it's the same idea behind prime numbers. In theory-- and in prime numbers, it's not theory, we know you can't break them down into products of smaller natural numbers. Things like 6-- you could say, hey, 6 is 2 times 3. You can break it down. And notice we can break it down as a product of prime numbers. We've kind of broken it down into its parts. 7, you can't break it down anymore. All you can say is that 7 is equal to 1 times 7, and in that case, you really haven't broken it down much. You just have the 7 there again. 6 you can actually break it down. 4 you can actually break it down as 2 times 2. Now with that out of the way, let's think about some larger numbers, and think about whether those larger numbers are prime. So let's try 16. So clearly, any number is divisible by 1 and itself. Any number, any natural number you put up here is going to be divisible by 1 and 16. So you're always going to start with 2. So if you can find anything else that goes into this, then you know you're not prime. And 16, you could have 2 times 8, you could have 4 times 4. So it's got a ton of factors here above and beyond just the 1 and 16. So 16 is not prime. What about 17? 1 and 17 will definitely go into 17. 2 doesn't go into 17. 3 doesn't go. 4, 5, 6, 7, 8, 9 10, 11-- none of those numbers, nothing between 1 and 17 goes into 17. So 17 is prime. And now I'll give you a hard one. This one can trick a lot of people. What about 51? Is 51 prime? And if you're interested, maybe you could pause the video here and try to figure out for yourself if 51 is a prime number. If you can find anything other than 1 or 51 that is divisible into 51. It seems like, wow, this is kind of a strange number. You might be tempted to think it's prime. But I'm now going to give you the answer-- it is not prime, because it is also divisible by 3 and 17. 3 times 17 is 51. So hopefully that gives you a good idea of what prime numbers are all about. And hopefully we can give you some practice on that in future videos or maybe some of our exercises.