Skip to main content
Mathematics LibreTexts

5.1: Primes, Composites, and Divisibility

  • Page ID
    185691
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\ket}[1]{\left| #1 \right>}\)
    \(\newcommand{\bra}[1]{\left< #1 \right|}\)
    \(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
    \(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
    \(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
    \(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
    \(\newcommand{\expect}[1]{\langle #1 \rangle}\)
    \(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    While the formal study of prime and composite numbers typically occurs in later elementary grades, it plays a crucial role in deepening children's understanding of multiplication, division, number sense, fractions, and lays a foundation for more advanced mathematical concepts like algebra. Recognizing the patterns and unique properties of these numbers can also contribute to fostering mathematical curiosity and an appreciation for the structure of our number system.

    Wonder, Play, Grow Blue Square.png Squares, Rectangles, or Sticks? A Number Shape Investigation

    Let’s explore what numbers can become when we build with unit squares.

    We’ll imagine each number as blue squares Blue Square.png , and ask:

    • Can we arrange them into a perfect square?
    • Or can they only be laid out in a stick (a single row or column)?
    • Can we arrange them into a rectangle that’s not a square nor a stick? (FYI: A square and a stick are technically not rectangles)

    Examples:

    • 1 square: This is a square! Just one small square. ✅
    • 2 squares: We can only make a stick (1×2 or 2×1). ❌ Not a square.
    • 3 squares: Still just a stick. ❌
    • 4 squares: Yes! A 2×2 square! ✅, a stick too.
    • 5 squares: Only a stick again. ❌
    • 6 squares: Not a square, but we can make a 2×3 rectangle and a stick. ✅
    Math Note

    From geometry we know that a square is actually a rectangle too, but a rectangle is not a square. And the "stick" in this investigation is technically a rectangle too.

    Bar chart-style visual showing the numbers 1 through 6 represented by stacked blue squares. Each number has a corresponding stack of squares equal to its value (e.g., 1 has 1 block, 2 has 2 blocks, etc.), arranged in a grid-like pattern.

    TASK 1: For each number from 1 to 17, ask: (Interactive Shapes you can use to help with the exploration)

    • Can I make a square (equal rows and columns)?
    • Can I make a rectangle with more than 1 row and more than 1 column, but not equal?
    • Or can I only make a stick (just one row or column)?

    Task 2:

    • Which numbers can only be sticks?
    • Which can form rectangles?
    • Which can form squares?
    • After 17, what number is the next stick, rectangle, and square?
    • What do you notice and wonder about now?

    Adapted from nrich Numbers as Shapes

    🧠Let's Listen to Learn❤️

     

    Prime Numbers and Composites

    There is something deeply poetic about prime numbers. These indivisible building blocks of the number world sit like hidden treasures in the vast sea of integers—mysterious, unpredictable, and infinitely many. From ancient Greek mathematicians marveling at their simplicity, to modern cryptographers relying on them to secure digital life, primes have always held a magnetic pull on human curiosity. If this piques your interest in anyway, and before we jump into the ideas prime and composite numbers, take a look at the article Why prime numbers still fascinate mathematicians, 2,300 years later.

    Definition: Prime and Composite Numbers

    A counting number with exactly two different factors (itself and 1) is called a prime number, or a prime. A counting number with more than two factors is called a composite number, or a composite.

    Factor

    A factor of a whole number is another whole number that divides it exactly, with no remainder.

    For example, 2, 3, 5, 7, 11 are primes, since they have only themselves and 1 as factors; 4, 6, 8, 9, 10 are composites, since they each have more than two factors; 1 is neither prime nor composite, since 1 is its only factor. An algorithm used to find primes is called the Sieve of Eratosthenes. Here is a worksheet that takes you through the process or we can see our favorite math educator Dr. Howie Hua explain How to quickly find all prime numbers from 1 to 100 #math.

    From your chart, the highlighted prime numbers between 1 and 100 are:  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

    Composite numbers have more than two factors and can be expressed as the product of two smaller numbers. Figure 5.1.1 shows how a composite (48) can be expressed as the product of smaller numbers using factor trees.

    48 Factor Trees.png

    Figure \(\PageIndex{1}\): Factor Trees for 48

    Notice that 48 was expressed as the product of two factors in several different ways. However, when we kept factoring until we reached primes, each method led us to the same prime factorization, namely 24 x 3 = 48.

    Theorem \(\PageIndex{1}\) Fundamental Theorem of Arithmetic

    Each composite number can be expressed as the product of primes in exactly one way (except for the order of the factors).

    Example \(\PageIndex{1}\)

    Express each number as a product of primes.

    a) 84 b) 180 c) 324

    Answer

    a) 84 = 4 x 21 = 2 x 2 x 3 x 7 = 22 x 3 x 7

    b) 180 = 10 x 18 = 2 x 5 x 2 x 3 x 3 = 22 x 32 x 5

    c) 324 = 4 x 81 = 2 x 2 x 3 x 3 x 3 x 3 = 22 x 34

    Prime Factors - Step by Step

    Enter a whole number and explore it's decomposition into prime factors.

     

    We will now look at some shortcuts (in addition to using a calculator) to help us find prime factors.

    Definition: Divides

    "a divides b" if there exists a whole number, n, such that an = b. This is written "a|b" if there exists a whole number, n, such that an = b, In words, a|b if and only if a is a factor of b. When a divides b, we can also say that a is a divisor of b, a is a factor of b, b is a multiple of a, and b is divisible by a.

    When you see 12/3, this means 12 "divided by" 3. The slash that slants to the right is another way to write the division sign, \(\div\). 12/3 (or \(12 \div 3\)) is a division problem, and the answer is 4.

    Here is something altogether different. If I say "3 divides 12", I am making a statement. "3 divides 12" is not a division problem that needs to be done. It is a statement that happens to be true. The symbol used to represent the word "divides" is a vertical line. So, "3 divides 12" can be written "3|12". Again, this is a statement, a fact, not a division problem. The way to express "does not divide" is to put a slash through the symbol: \(\not{l}\)

    So, how do I know "3 divides 12" is a true statement? The definition of "divides" follows:

    Okay, so what exactly does "there exists a whole number, n, such that an = b" mean? Well, it means that the first number times some whole number equals the second number. Or you can think "a divides b" is true if \(b \div a\) is a whole number.

    Let's get back to why "3 divides 12" is a true statement. Hmmm...you can be formal and ask yourself: Is there a whole number n such that 3n = 12? Or, you can simply ask yourself: Is 3 a factor (or divisor) of 12? In either case, the answer is yes, so the statement is true.

    Let's work a little more on the difference between a statement using "divides", and an actual division problem.

    Example \(\PageIndex{2}\)

    Determine if each of the following is a statement or if it is a division problem. If it is a statement, state if it is true or false and back up your answer. If it is a division problem, state the answer to the division problem.

    a) 4|20 b) 20/6 c) 15|3 d) 6 divides 20 e) 3 divides 21

    Answer

    a) This is a true statement, because 4 is a factor of 20 (since \(4 \cdot 5 = 20\))

    b) This is a division problem. The answer is 3 r. 2

    c) This is a false statement because 15 is not a factor of 3

    d) This is a false statement because 6 is not a factor of 20

    e) This is a true statement because 3 is a factor of 21 (since \(3 \cdot 7 = 21\))

    Think About and Discuss

    Think about whether the following are True or False. Then explain to your peers your answers.

    i) 8 is a divisor of 96

    ii) 216 is a multiple of 6

    iii) 51 is divisible by 17

    iv) (22 • 3) | (23 • 32 • 5)

    Test for Divisibility

    Divisibility tests may seem old-fashioned in a world with calculators, but they are deeply important for young math learners. Divisibility tests help young learners develop number sense, logical reasoning, and mental math skills, fostering a deeper understanding of mathematical patterns and relationships. Unlike calculators that provide answers, divisibility rules teach students how to think mathematically. Keep in mind that list below is not intended for you to memorize, but to understand where they come from and how it is all related to the ideas of factors, multiples, and divisors.

    Listed below are the divisibility tests that you should know. It's important to realize that each of the tests only work for the number specified. In other words, you can't use the divisibility test for 3 to determine is 7 divides a number.

    Divisibility Tests

    All counting numbers can be considered factors of zero. In other words, for all counting numbers, m, m|0 is always true since there is always some number times m that equals zero, namely zero itself. Assume n is a positive whole number. The following are divisibility tests to determine what numbers divide into n, or what numbers are factors of n.

    • Divisibility Test for 2: 2|n if the last digit of n is even (0, 2, 4, 6, or 8)
    • Divisibility Test for 3: 3|n if and only if the sum of its digits is divisible by 3.
    • Divisibility Test for 4: 4|n if 4|(the number represented by the last two digits of n)
    • Divisibility Test for 5: 5|n if the last digit of n is 0 or 5
    • Divisibility Test for 6: 6|n if 2|n AND 3|n. (Think of 6 as \(2 \cdot 3\))
    • Divisibility Test for 7: The steps of this test are described below.
    • Step 1: Cross off the one's digit of the number to get a number with one less place value.
    • Step 2: Double the one's digit you crossed off and subtract from the new number without the one's digit.
    • Step 3: If 7 divides the number you get after subtracting, it divides the original number. Otherwise, it doesn't. If you aren't sure, repeat the procedure on the new number by going back to step 1.
    • Divisibility Test for 8: 8|n if 8|(the number represented by the last three digits of n)
    • Divisibility Test for 9: 9|n if the sum of its digits is divisible by 9.
    • Divisibility Test for 10: 10|n if the last digit of n is 0
    • Divisibility Test for 11: 11|n if the difference between the sum of the digits in the places that are even powers of 10 and the sum of the digits in the places that are odd powers of 10 is divisible by 11
    • Divisibility Test for 15: 15|n if 5|n AND 3|n

    🧠Let's Listen to Learn❤️

     

    Example \(\PageIndex{3}\)

    Use the divisibility test for 2 to determine if the following is true or false

    1. 2|97

    This is false because the last digit (7) is not even

    2. 2|356

    This is true because the last digit (6) is even

    Use the divisibility test for 4 to determine if the following is true or false.

    1. 4|527

    This is false because 4 does not divide 27, (since 4 is not a factor of 27).

    2. 4|25,356

    This is true because 4|56.

    Use the divisibility test for 5 to determine if the following is true or false.

    1. 5|527

    This is false because 7 is the last digit of 527

    2. 5|25,335

    This is true because 5 is the last digit of 25,335

    Use the divisibility test for 3 to determine if the following is true or false.

    1. 3|97

    This is false because 3 does not divide 16 (9+ 7)

    2. 3|738

    This is true because 3 divides 18 (7+3+8)

    Use the divisibility test for 6 to determine if the following is true or false.

    1. 6|627

    This is false because 2 does not divide 7 (the last digit, which is not even).

    2. 6|7,620

    This is true because 2|7,620 (since the last digit, 0, is even) AND 3 divides 15 (7+6+2+0)

    Use the divisibility test for 11 to determine if the following is true or false.

    a. 11|4,365: Add 4 + 6 = 10 Add 3 + 5 = 8 Subtract 10 – 8 = 2 Since 11 doesn't divide 2, then 11 doesn't divide 4365. Therefore, 11|4365 is false.

    b. 11|542,879,216: Add 5 + 2 + 7 + 2 + 6 = 22 Add 4 + 8 + 9 + 1 = 22 Subtract 22 – 22 = 0 Since 11|0, then 11|542,879,216 is true.

    Example \(\PageIndex{4}\)

    What divides evenly into 3495?

     

    Number

    Check it!

    Yes or No?

    2

    Is 3495 even?

    no

    3

    Add the digits: 3 + 4 + 9 + 5 = 21 and 21 divides 3 evenly

    yes

    4

    Can 95 divide 4 evenly?

    no

    5

    Ends in 0 or 5?

    yes

    6

    Divisible by both 2 AND 3?

     

    8

    Can 495 divide 8 evenly?

     

    9

    Add the digits: 3 + 4 + 9 + 5 = 21 and 21 does not divide 9 evenly

     

    10

    Ends in 0?

     
    11    
    15    
    Answer

    2 - no, 3 - yes, 4 - no, 5 - yes, 6 - no, 8 - no, 9 - no, 10 - no , 11 - no, 15 - yes

    Wonder, Play, Grow

    Work with your peers to play around with the ideas below.

    Let a, m, n, and k be whole numbers where a ≠ 0.

    Task 1: Is the following statement true? If a|b and a|c, then a|(b+c).

    Task 2: Is the following statement true? If a|b and a|c, then a|(b-c), b≥c.

    Now that you played around with some number theory like a mathematician would do, you probably recognize that 3 | 27 and 3 | 9. It is also true that 3 | (27 + 9) and that 3 | (27 − 9). This is an instance of the following theorem.

    Theorem \(\PageIndex{1}\)

    Let a, b, c, and k be whole numbers where a ≠ 0.

    a. If a | b and a | c, then a | (a + b).

    b. If a | b and a | c, then a | (a − b) for m ≥ n.

    c. If a | b, then a | kb.

    Note on theorems in mathematics: While the direct content of most theorems may not be taught in elementary school, the underlying principles of logical reasoning, justification, and the interconnectedness of mathematical ideas, which are central to theorems, are crucial for effective elementary mathematics teaching. Learning about theorems empowers future teachers with a deeper understanding of the structure and nature of mathematics, enabling them to teach with greater clarity, confidence, and a focus on sense-making for their students. Learning theorems prepares you to teach not just procedures, but the thinking and truth-seeking that makes math meaningful.

    Think About and Discuss

    Is 137 a prime number? How can we quickly check that? Discuss with your peers how they figured it out.

    🧠Let's Listen to Learn❤️

     

    Prime Factor Test

    To test for prime factors of a number n, one need only search for prime factors p of n, where 𝑝2 ≤ 𝑛 (or \(p\le \sqrt{n}\) )

    Example \(\PageIndex{5}\)

    Determine whether the following numbers are prime or composite.

    a) 299

    b) 401

    Answer

    a) Only the prime factors 2 through 17 need to be checked, since 172< 299 < 192 (check this on your calculator) or because \(\sqrt{299}\approx 17.29\). None of the numbers 2, 3, 5, 7, or 11 is a factor, but since 299 = 13 x 23, the number 299 is composite.

    b) Only primes 2 through 19 need to be checked, since \(\sqrt{401}\approx 20\). Since none of the primes 2 through 19 are factors of 401, we know that 401 is a prime. (The tests for divisibility show that 2, 3, 5, and 11 are not factors of 401. A calculator, tests for divisibility, or long division can be used to check 7, 13, 17, and 19.)


    5.1: Primes, Composites, and Divisibility is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by LibreTexts.