Alexander Bass
This note is one of many taken during 2025

Complete Factorization

Quick! what are all the factors of 720720?

Instead of giving you an answer, here’s an algorithm to find it.

First, by repeated division, find the prime factors.

720/2=360360/2=180180/2=9090/2=4545/3=1515/3=55/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*} F0=[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 F0F_{0} to create P0P_{0}.

P0={2,3,5,6,10,15,30} P_{0} = \{2,\,3,\,5,\,6,\,10,\,15,\,30\} S0=P0 S_{0} = P_{0}

Remove one of each unique factor from F0F_{0} to make F1F_{1}.

F1=[2,2,2,2,3,3,5] F_{1} = [\,\cancel{2},\,2,\,2,\,2,\,\cancel{3},\,3,\,\cancel{5}]

Find the all unique factors and their cartesian products in F1F_{1} to create P1P_{1}.

P1={2,3,6} P_{1} = \{\, 2,\,3,\,6 \,\}

Multiply each number in P1P_{1} by each number in S0S_{0} to find S1S_{1} Remove any duplicate values and remove any values which had been found in previous SnS_{n}.

S1={4,6,10,12,20,30,606,9,15,18,30,45,9012,18,30,36,60,90,180}S1={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*}

Remove one of each unique factor from F1F_{1} to make F2F_{2}.

F2=[2,2,2,2,3,3,5] F_{2} = [\,\cancel{2},\,\cancel{2},\,2,\,2,\,\cancel{3},\,\cancel{3},\,\cancel{5}]

Find the all unique factors and their cartesian products in F2F_{2} to create P2P_{2}.

P2={2} P_{2} = \{\, 2\, \}

Multiply each number in P2P_{2} by each number in S1S_{1} to find S2S_{2} Remove any duplicate values and remove any values which had been found in previous SnS_{n}.

S2={8,20,24,40,120,18,36,90,180,72,360}S2={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*}

Remove one of each unique factor from F2F_{2} to make F3F_{3}.

F3=[2,2,2,2,3,3,5] F_{3} = [\,\cancel{2},\,\cancel{2},\,\cancel{2},\,2,\,\cancel{3},\,\cancel{3},\,\cancel{5}]

Find the all unique factors and their cartesian products in F3F_{3} to create P3P_{3}.

P3={2} P_{3} = \{\, 2\, \}

Multiply each number in P3P_{3} by each number in S2S_{2} to find S3S_{3} Remove any duplicate values and remove any values which had been found in previous SnS_{n}.

S3={16,48,80,240,144,720} S_{3} = \{\,16,\,48,\,80,\,240,\,144,\,720 \,\}

Remove one of each unique factor from F3F_{3} to make F4F_{4}.

F4=[2,2,2,2,3,3,5] F_{4} = [\,\cancel{2},\,\cancel{2},\,\cancel{2},\,\cancel{2},\,\cancel{3},\,\cancel{3},\,\cancel{5}]

Seeing as there are no more prime factors left in FF, Halt. The factors of 720720 are found in the union S0,S1,S2,S3S_0,\,S_1,\,S_2,\, S_3 and of course 11.

S={1}S0S1S2S3S={={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*}

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