Hacking Secret Ciphers with Python

(Ann) #1

200 http://inventwithpython.com/hacking


Email questions to the author: [email protected]


8 × 3 = 24


12 × 2 = 24


24 × 1 = 24


From the above three math problems, we can see that 8 and 3 are also factors of 24, as are 12 and
2, and 24 and 1. So we can say the factors of 24 are: 1, 2, 3, 4, 6, 8, 12, and 24.


Let’s look at the factors of 30:


1 × 30 = 30

2 × 15 = 30

3 × 10 = 30

5 × 6 = 30

So the factors of 30 are 1, 2, 3, 5, 6, 10, 15, and 30. (Notice that any number will always have 1
and itself as factors.) If you look at the list of factors for 24 and 30, you can see that the factors
that they have in common are 1, 2, 3, and 6. The greatest number of these is 6, so we call 6 the
greatest common factor (or, more commonly, the greatest common divisor) of 24 and 30.


Visualize Factors and GCD with Cuisenaire Rods


Figure 14 - 2. Each Cuisenaire rod has a different color for each integer length.
Free download pdf