# How do you find the GCF of 28 and 42?

Jan 10, 2017

$G C F \left(28 , 42\right) = \textcolor{g r e e n}{14}$

#### Explanation:

Method 1: GCF Algorithm
min $\leftarrow$ smaller number
max $\leftarrow$ larger number
rem $\leftarrow$ remainder of integer division: max $\div$ min
while rem $\ne 0$
$\textcolor{w h i t e}{\text{XX}}$max$\leftarrow$min
$\textcolor{w h i t e}{\text{XX}}$min$\leftarrow$rem
$\textcolor{w h i t e}{\text{XX}}$rem $\leftarrow$ remainder of integer division: max $\div$ min
end_while
GCF$\leftarrow$min

$\textcolor{w h i t e}{\text{XX}}$Application with 28 and 42
min $\leftarrow$ 28
max $\leftarrow$ 42
rem $\leftarrow$ 14 (since $42 \div 28 = 2 R 14$)
since $14 \ne 0$ do the "while"
$\textcolor{w h i t e}{\text{XX}}$max$\leftarrow$28
$\textcolor{w h i t e}{\text{XX}}$min$\leftarrow$14
$\textcolor{w h i t e}{\text{XX}}$rem$\leftarrow$0 (since $28 \div 14 = 2 R 0$)
loop back to re-test loop condition
since $0 = 0$ continue with instructions following the while loop
GCF$\leftarrow$14

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Method 2: Collecting Common Prime Factors
Factoring $28$
$\textcolor{w h i t e}{\text{XX}} 28 = 2 \times 14 = 2 \times 2 \times 7$
Factoring $42$
$\textcolor{w h i t e}{\text{XX}} 42 = 2 \times 21 = 2 \times 3 \times 7$
Extract common prime factors:
$G C F \left(\cancel{2} \times 2 \times 7 , \cancel{2} \times 3 \times 7\right)$
$\textcolor{w h i t e}{\text{XX}} = 2 \times G C F \left(2 \times \cancel{7} , 3 \times \cancel{7}\right)$
$\textcolor{w h i t e}{\text{XX}} = 2 \times 7 \times G C F \left(2 , 3\right)$
$\textcolor{w h i t e}{\text{XX}} = 2 \times 7 \times 1$
$\textcolor{w h i t e}{\text{XX}} = 14$

Jan 11, 2017

$\text{ "28=2xx14 = color(red)(2)xx2" } \times \textcolor{red}{7}$
$\underline{\text{ "42=2xx21=color(red)(2)" } \times 3 \times \textcolor{red}{7}}$
$\text{common factors"->color(purple)(color(white)(.)2" } 7$
So the greatest common factor (GCF) is $2 \times 7 = 14$