This note is one of many taken during 2025
Complete Factorization
April 9th 2025
Quick! what are all the factors of
720 720 720 ?
Instead of giving you an answer, here’s an algorithm to find it.
First, by repeated division, find the prime factors.
720 / 2 = 360 360 / 2 = 180 180 / 2 = 90 90 / 2 = 45 45 / 3 = 15 15 / 3 = 5 5 / 5 = 1
\begin{align*}
720 / 2 &= 360 \\
360 / 2 &= 180 \\
180 / 2 &= 90 \\
90 / 2 &= 45 \\
45 / 3 &= 15 \\
15 / 3 &= 5 \\
5 / 5 &= 1 \\
\end{align*}
720/2 360/2 180/2 90/2 45/3 15/3 5/5 = 360 = 180 = 90 = 45 = 15 = 5 = 1
F 0 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ]
F_{0} = [2,\,2,\,2,\,2,\,3,\,3,\,5]
F 0 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ] Find the all unique factors and their cartesian products in
F 0 F_{0} F 0 to create
P 0 P_{0} P 0 .
P 0 = { 2 , 3 , 5 , 6 , 10 , 15 , 30 }
P_{0} = \{2,\,3,\,5,\,6,\,10,\,15,\,30\}
P 0 = { 2 , 3 , 5 , 6 , 10 , 15 , 30 }
S 0 = P 0
S_{0} = P_{0}
S 0 = P 0 Remove one of each unique factor from
F 0 F_{0} F 0 to make
F 1 F_{1} F 1 .
F 1 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ]
F_{1} = [\,\cancel{2},\,2,\,2,\,2,\,\cancel{3},\,3,\,\cancel{5}]
F 1 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ] Find the all unique factors and their cartesian products in
F 1 F_{1} F 1 to create
P 1 P_{1} P 1 .
P 1 = { 2 , 3 , 6 }
P_{1} = \{\, 2,\,3,\,6 \,\}
P 1 = { 2 , 3 , 6 } Multiply each number in
P 1 P_{1} P 1 by each number in
S 0 S_{0} S 0 to find
S 1 S_{1} S 1 Remove any duplicate values and remove any values which had been found in previous
S n S_{n} S n .
S 1 = { 4 , 6 , 10 , 12 , 20 , 30 , 60 6 , 9 , 15 , 18 , 30 , 45 , 90 12 , 18 , 30 , 36 , 60 , 90 , 180 } S 1 = { 4 , 10 , 12 , 20 , 60 , 9 , 18 , 45 , 90 , 36 , 180 }
\begin{align*}
S_{1} = \{\,& 4,\,\cancel{6},\,10,\,12,\,20,\,\cancel{30},\,60\\
& \cancel{6},\,9,\,\cancel{15},\,18,\,\cancel{30},\,45,\,90\\
& \cancel{12},\,\cancel{18},\,\cancel{30},\,36,\,\cancel{60},\,\cancel{90},\,180
\}\\
S_{1} = \{\,& 4,\,10,\,12,\,20,\,60,\,9,\,18,\,45,\,90,\,36,\,180\}
\end{align*}
S 1 = { S 1 = { 4 , 6 , 10 , 12 , 20 , 30 , 60 6 , 9 , 15 , 18 , 30 , 45 , 90 12 , 18 , 30 , 36 , 60 , 90 , 180 } 4 , 10 , 12 , 20 , 60 , 9 , 18 , 45 , 90 , 36 , 180 } Remove one of each unique factor from
F 1 F_{1} F 1 to make
F 2 F_{2} F 2 .
F 2 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ]
F_{2} = [\,\cancel{2},\,\cancel{2},\,2,\,2,\,\cancel{3},\,\cancel{3},\,\cancel{5}]
F 2 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ] Find the all unique factors and their cartesian products in
F 2 F_{2} F 2 to create
P 2 P_{2} P 2 .
P 2 = { 2 }
P_{2} = \{\, 2\, \}
P 2 = { 2 } Multiply each number in
P 2 P_{2} P 2 by each number in
S 1 S_{1} S 1 to find
S 2 S_{2} S 2 Remove any duplicate values and remove any values which had been found in previous
S n S_{n} S n .
S 2 = { 8 , 20 , 24 , 40 , 120 , 18 , 36 , 90 , 180 , 72 , 360 } S 2 = { 8 , 24 , 40 , 120 , 72 , 360 }
\begin{align*}
S_{2} &=\{\,8,\, \cancel{20},\, 24,\,40,\, 120,\, \cancel{18},\, \cancel{36},\, \cancel{90},\, \cancel{180},\, 72,\, 360\,\}\\
S_{2} &=\{\,8,\, 24,\,40,\, 120,\, 72,\, 360\,\}\\
\end{align*}
S 2 S 2 = { 8 , 20 , 24 , 40 , 120 , 18 , 36 , 90 , 180 , 72 , 360 } = { 8 , 24 , 40 , 120 , 72 , 360 } Remove one of each unique factor from
F 2 F_{2} F 2 to make
F 3 F_{3} F 3 .
F 3 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ]
F_{3} = [\,\cancel{2},\,\cancel{2},\,\cancel{2},\,2,\,\cancel{3},\,\cancel{3},\,\cancel{5}]
F 3 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ] Find the all unique factors and their cartesian products in
F 3 F_{3} F 3 to create
P 3 P_{3} P 3 .
P 3 = { 2 }
P_{3} = \{\, 2\, \}
P 3 = { 2 } Multiply each number in
P 3 P_{3} P 3 by each number in
S 2 S_{2} S 2 to find
S 3 S_{3} S 3 Remove any duplicate values and remove any values which had been found in previous
S n S_{n} S n .
S 3 = { 16 , 48 , 80 , 240 , 144 , 720 }
S_{3} = \{\,16,\,48,\,80,\,240,\,144,\,720 \,\}
S 3 = { 16 , 48 , 80 , 240 , 144 , 720 } Remove one of each unique factor from
F 3 F_{3} F 3 to make
F 4 F_{4} F 4 .
F 4 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ]
F_{4} = [\,\cancel{2},\,\cancel{2},\,\cancel{2},\,\cancel{2},\,\cancel{3},\,\cancel{3},\,\cancel{5}]
F 4 = [ 2 , 2 , 2 , 2 , 3 , 3 , 5 ] Seeing as there are no more prime factors left in
F F F , Halt. The factors of
720 720 720 are found in the union
S 0 , S 1 , S 2 , S 3 S_0,\,S_1,\,S_2,\, S_3 S 0 , S 1 , S 2 , S 3 and of course
1 1 1 .
S = { 1 } ∪ S 0 ∪ S 1 ∪ S 2 ∪ S 3 S = { = { 1 , 2 , 3 , 4 , 5 , 6 , 8 , 9 , 10 , 12 , 15 , 16 , 18 , 20 , 24 , 30 , 36 , = { 40 , 45 , 48 , 60 , 72 , 80 , 90 , 120 , 144 , 180 , 240 , 360 , 720 = { }
\begin{align*}
S &= \{1\}\cup S_0 \cup S_1 \cup S_2 \cup S_3 \\
S &=\{\\
&\phantom{=\{}1,\,2,\,3,\,4,\,5,\,6,\,8,\,9,\,10,\,12,\,15,\,16,\,18,\,20,\,24,\,30,\,36,\\
&\phantom{=\{}40,\,45,\, 48,\,60,\,72,\,80,\,90,\,120,\,144,\,180,\,240,\,360,\,720 \\
&\phantom{=\{}\}
\end{align*}
S S = { 1 } ∪ S 0 ∪ S 1 ∪ S 2 ∪ S 3 = { = { 1 , 2 , 3 , 4 , 5 , 6 , 8 , 9 , 10 , 12 , 15 , 16 , 18 , 20 , 24 , 30 , 36 , = { 40 , 45 , 48 , 60 , 72 , 80 , 90 , 120 , 144 , 180 , 240 , 360 , 720 = { } I don’t know the name of this algorithm. I figured it out myself, but the simplicity of the algorithm leads me to believe it has been known for quite some time.
There are likely more efficient algorithms, but compared to the naive algorithm of dividing by all numbers less than, it is appreciably efficient.
An advantage of this algorithm is that it can be done on pen-and-paper and also can be done using a computer.
Example Python Program
This note is one of many taken during 2025