Discrete MathematicsDivisibility, Primes and Greatest Common Divisors4 of 6
Divisibility, Primes and Greatest Common Divisors · 4
Counting and Summing Divisors from Prime Factorizations
Listing divisors by trial division works for small numbers, but for larger numbers we need a way to count and add every positive divisor directly from the prime factorization.
1
Counting Divisors with Prime Menus
We want to find how many positive divisors a number like 72 or 720 has without listing them all out. From the Fundamental Theorem of Arithmetic, every positive integer breaks down into a unique bag of prime bricks, so any divisor d in d×k=72 is formed by pulling a sub-collection of bricks out of the bag while the leftover bricks automatically form the partner factor k.
Counting Divisors with Prime Menus
Text solution
Factor the number into prime powersBreak 72 and 720 down into their prime building blocks so we can see how many bricks of each prime are in the bag.
72720=8×9=23⋅32=72×10=24⋅32⋅51
Add 1 to each exponent for the "take zero" optionA divisor can use anywhere from 0 up to the maximum available copies of each prime, where taking zero copies of p is written as p0=1 (it contributes a factor of 1, not 0, to the divisor).
For 72=23⋅32:3+1=4 choices20,21,22,23,2+1=3 choices30,31,32For 720=24⋅32⋅51:5 choices for 24+1,3 choices for 32+1,2 choices for 51+1
Multiply the menu sizesBecause prime factorizations are unique, every combination of menu choices produces a different divisor.
Divisors of 72Divisors of 720=4×3=12=5×3×2=30
So 72 has 12 positive divisors and 720 has 30 positive divisors, found without listing a single divisor.
In the card below, every sub-collection of prime bricks pulled from the bag of 72=23⋅32 lights up a unique (2a,3b) cell in the 4×3 menu grid, while the bricks left behind in the bag multiply to form the partner factor k in d×k=72.
Each choice of prime bricks you pull from the bag lands on its own box in the grid, while the bricks left behind multiply to make the partner factor.
2
Counting Divisors with Conditions
Suppose we only want to count the divisors of 720 that satisfy a condition, such as being even, odd, a perfect square, or a perfect cube. Instead of testing all 30 divisors one by one, we can filter the prime menus before multiplying their sizes.
Counting Divisors with Conditions
Text solution
Write out the full prime menus for 720Start with all available powers for each prime in 720=24⋅32⋅51.
Menu for 2Menu for 3Menu for 5:20,21,22,23,24:30,31,32:50,51
Cross off disallowed powers for even or odd divisorsAn even divisor needs at least one 2 (which removes 20), while an odd divisor cannot use any 2s (which leaves only 20).
Even divisors: keep 21,22,23,244×3×2=24Odd divisors: keep only 201×3×2=6
Keep only even exponents for perfect squaresA perfect square n×n splits its prime bricks into two identical piles, which means every prime exponent must be even (0,2,4,…).
Keep only multiples of 3 in the exponents for perfect cubesA perfect cube n×n×n splits its bricks into three identical piles, so every prime exponent must be a multiple of 3(0,3,6,…).
So out of the 30 divisors of 720,24 are even, 6 are odd, 6 are perfect squares, and 2 are perfect cubes (1 and 8).
Watch out for primes that appear only to the first power, like 51 in 720: since 0 is both an even number and a multiple of 3, the choice 50=1 stays on the menu, giving 1 choice for 5 rather than 0.
In this card, crossing options off the prime menus for 720 dims out every divisor in the table that uses a forbidden prime power, while the count of remaining divisors always equals the product of the remaining menu lengths.
Crossing powers off the prime menus of 720 filters its divisors, and the number of divisors left is always the product of the remaining menu lengths.
3
Working Backward from the Divisor Count
Now let's reverse the question: instead of starting with a number and counting its divisors, we want to start with a divisor count, such as having an odd number of divisors or having exactly 6 divisors, and find what the number's prime factorization must look like.
Working Backward from the Divisor Count
Text solution
Check when the product of menu sizes is oddA product of whole numbers is odd if and only if every factor (ai+1) is odd, which forces every prime exponent ai to be even.
⟺⟺⟺Odd divisor countevery (ai+1) is oddevery ai is evenperfect square
Factor the target count 6 into menu sizes greater than 1To find the smallest positive integer with 6 divisors, write every way 6 can be expressed as a product of menu sizes, then subtract 1 from each menu size to find the prime exponents.
One menu of size 6:a1=6−1=5⟹p15Two menus of sizes 3×2:a1=3−1=2,a2=2−1=1⟹p12⋅p21
Put the smallest primes on the largest exponents and compareChoosing 2,3,… for the primes makes each candidate as small as possible.
Candidate 1: Candidate 2: 25=3222⋅31=4×3=12
Comparing the two candidates shows that 12 is the smallest positive integer with exactly 6 divisors.
4
Summing Divisors from Prime Menus
Next, we want to find the sum of all positive divisors of a number like 72,720, or 28⋅35 without listing the divisors first. Looking at the divisor grid for 72, each row has a common power of 2 that can be factored out in front of (1+3+9).
When a prime has a large exponent, adding its menu by hand takes too long, so we use the geometric sum formula to add the menu in one step:
1+p+p2+⋯+pa=p−1pa+1−1
Summing Divisors from Prime Menus
Text solution
Add each prime's menu and multiply the sumsFor small exponents like those in 72=23⋅32 and 720=24⋅32⋅51, we can add the powers on each menu directly and multiply the sums together.
Sum for 72=15(1+2+4+8)×13(1+3+9)=15×13=195Sum for 720=31(1+2+4+8+16)×13(1+3+9)×6(1+5)=31×13×6=2,418
Use the geometric sum shortcut for large exponentsFor 28⋅35, take the next power of each prime, subtract 1, and divide by p−1.
Sum of 2s menu=1+2+⋯+28=2−129−1=512−1=511Sum of 3s menu=1+3+⋯+35=3−136−1=2729−1=2728=364Sum for 28⋅35=511×364=186,004
So the 12 divisors of 72 add up to 195, the 30 divisors of 720 add up to 2,418, and the divisors of 28⋅35 add up to 186,004.
For any positive integer written in its prime factorization n=p1a1p2a2⋯pkak, the general divisor count and divisor sum formulas write out these two menu steps:
Here the symbol ∏ means we multiply the terms together across all primes p1,…,pk, just as ∑ means we add terms together.
Key concepts
Every divisor problem starts by factoring n=p1a1p2a2⋯pkak into its prime menus 1,pi,pi2,…,piai:
Counting all divisors (add 1 to each exponent and multiply)
Each prime power piai gives ai+1 choices once we include pi0=1. For 72=23⋅32, the count is (3+1)(2+1)=12.
Counting or summing with conditions (filter the menus first)
Cross off disallowed powers on each menu before counting or adding the remaining options. For even divisors of 72, cross off 20 to leave 3×3=9 divisors with sum (2+4+8)(1+3+9)=14×13=182; for perfect squares, keep only even exponents (0,2,4,…).
Working backward from the count (factor the count into menu sizes)
An odd divisor count happens if and only if n is a perfect square. To find the smallest number with a given divisor count, check every way to factor the count into menu sizes greater than 1 (don't stop at two primes if the count factors into three, like 12=3×2×2 for 22⋅31⋅51=60) and put the largest exponents on the smallest primes.
Summing divisors (add each menu, then multiply)
Multiply the sums of the menus using p−1pa+1−1 when exponents are large (for p=2, the denominator is 1, so 1+2+⋯+2a is just 2a+1−1). When an exponent is small (like 32 or 51) or when a condition crosses powers off a menu, don't use the geometric sum fraction: just add the remaining powers directly, like 1+3+9=13.
5
Practice
1
How many positive divisors does 1,800 have?
Be careful not to multiply the exponents directly as 3×2×2=12; forgetting to add 1 for the p0=1 option on each menu leaves out the "take zero" choices.
Factor 1,800 as 18×100 first, collect the powers of each prime, and remember the "take zero" option on each menu.
Factoring 1,800 into primes gives:
1,800=18×100=(2⋅32)×(22⋅52)=23⋅32⋅52
Be careful not to multiply the exponents directly as 3×2×2=12; forgetting to add 1 for the p0=1 option on each menu leaves out the "take zero" choices. Adding 1 to each exponent gives the menu sizes:
(3+1)(2+1)(2+1)=4×3×3=36
2
How many positive divisors of 3,600 are multiples of 12?
Watch out for subtracting exponents directly (4−2=2 and 2−1=1, which gives 2×1×3=6) or forgetting 50 (which gives 3×2×2=12).
Break both 3,600 and 12 into primes: what is the minimum number of 2s and 3s a divisor must take from the menus of 3,600 to be a multiple of 12?
Factoring both numbers into primes gives 3,600=24⋅32⋅52 and 12=22⋅31. A divisor of 3,600 is a multiple of 12 if and only if it takes at least two 2s and at least one 3:
Menu for 2: cross off 20,21 to keep 22,23,24(3 choices).
Menu for 3: cross off 30 to keep 31,32(2 choices).
Menu for 5: no restriction, so keep 50,51,52(3 choices).
Watch out for subtracting exponents directly (4−2=2 and 2−1=1, which gives 2×1×3=6) or forgetting 50 (which gives 3×2×2=12); counting the remaining powers on each menu gives:
3×2×3=18
3
For n=27⋅34⋅56⋅7, how many of its positive divisors are perfect squares, and how many are perfect cubes?
Don't look at 71 and conclude there are 0 choices for 7 (which would make the product 0), and don't forget to include the exponent 0 on the other primes (which would give 3×2×3×1=18 for squares and 2×1×2×1=4 for cubes): 70=1 has exponent 0, which is both even and a multiple of 3.
Write out the allowed exponents (0,2,4,… for squares; 0,3,6,… for cubes) for each of the four primes, including 71.
Write n=27⋅34⋅56⋅71. Don't look at 71 and conclude there are 0 choices for 7 (which would make the product 0), and don't forget to include the exponent 0 on the other primes (which would give 3×2×3×1=18 for squares and 2×1×2×1=4 for cubes): 70=1 has exponent 0, which is both even and a multiple of 3.
For perfect squares (even exponents): 2 has 4 choices (0,2,4,6), 3 has 3 choices (0,2,4), 5 has 4 choices (0,2,4,6), and 7 has 1 choice (0):
4×3×4×1=48
For perfect cubes (exponents that are multiples of 3): 2 has 3 choices (0,3,6), 3 has 2 choices (0,3), 5 has 3 choices (0,3,6), and 7 has 1 choice (0):
3×2×3×1=18
This gives 48 perfect squares and 18 perfect cubes.
4
How many positive integers from 1 to 200 inclusive have an odd number of positive divisors, and how many have exactly 3 positive divisors?
Use the rule for which numbers have an odd divisor count first; then check how many ways the menu product can equal 3.
A positive integer has an odd number of divisors if and only if it is a perfect square. Since 142=196≤200<225=152, there are 14 such integers (12,22,…,142).
For a number to have exactly 3 divisors, its menu sizes must multiply to 3. Because 3 is prime, there is only one prime menu of size 3, so the number must have the form p2 for a prime p. Be careful not to count all 14 squares (for instance, 12=1 has 1 divisor and 42=16=24 has 5 divisors); only prime bases p≤14 work, which are 2,3,5,7,11,13 (giving 4,9,25,49,121,169). This gives 14 integers with an odd number of divisors and 6 with exactly 3 divisors.
5
What is the smallest positive integer that has exactly 12 positive divisors?
A common slip is stopping after two-prime factorizations at 23⋅32=72 and overlooking the three-prime split 3×2×2.
List all four ways to factor 12 into menu sizes greater than 1 (with one, two, or three prime menus) before comparing the resulting numbers.
Factor the divisor count 12 into menu sizes greater than 1 in every possible way, subtract 1 from each menu size to get the exponents, and put the largest exponents on the smallest primes:
Menu size 12: exponent 11⟹211=2,048.
Menu sizes 6×2: exponents 5,1⟹25⋅31=96.
Menu sizes 4×3: exponents 3,2⟹23⋅32=72.
Menu sizes 3×2×2: exponents 2,1,1⟹22⋅31⋅51=60.
A common slip is stopping after two-prime factorizations at 23⋅32=72 and overlooking the three-prime split 3×2×2. Comparing all four candidates gives 60.
6
Find the sum of all positive divisors of 8,000.
Watch out for two common slips here: forgetting to raise the exponent by 1 in the numerator (which gives 4(26−1)(53−1)=63×31=1,953) or forgetting to divide 54−1=624 by 5−1=4 (which gives 127×624=79,248).
Factor 8,000=8×1,000 into powers of 2 and 5, then apply the geometric sum shortcut to each prime menu.
Factoring 8,000 gives 8,000=8×1,000=26⋅53. Using the geometric sum formula on each menu:
Sum of 2s menu=26+1−1=27−1=127Sum of 5s menu=5−153+1−1=4625−1=4624=156
Watch out for two common slips here: forgetting to raise the exponent by 1 in the numerator (which gives 4(26−1)(53−1)=63×31=1,953) or forgetting to divide 54−1=624 by 5−1=4 (which gives 127×624=79,248). Multiplying the two menu sums gives:
127×156=19,812
7
Find the sum of all even positive divisors of 360.
Be careful not to use the full 2s menu sum 24−1=15 by mistake, which includes the odd divisors and gives 15×13×6=1,170.
Factor 360, cross off the one option on the 2s menu that makes a divisor odd, and add the remaining powers on each menu.
Factoring 360 gives 360=23⋅32⋅51. An even divisor must use at least one 2, so we cross 20=1 off the 2s menu. Be careful not to use the full 2s menu sum 24−1=15 by mistake, which includes the odd divisors and gives 15×13×6=1,170. Adding the remaining options on each menu and multiplying gives: