Introduction

In this unit we will discuss several functions related to the divisors of a number, including:

  1. d(n)d(n) is equal to the number of positive divisors of nn (including 11 and nn)
  2. σ(n)\sigma(n) is equal to the sum of the positive divisors of nn (including 11 and nn)
  3. φ(n)\varphi(n) (pronounced totient) denotes the number of positive integers, upto nn, that are relatively prime to nn

Why Divisor Functions

Divisor functions provide efficient ways to compute useful properties of an integer, many of which are frequently tested upon in competitions. Functions like Euler's totient function (#3 above) also have elegant connections to Number Theory that give rise to theorems like Fermat's Little Theorem.

Most of the time, these functions provide quick ways to find specific properties of a number that may initially seem very bashy.

Formulas

Let n=p1e1p2e2⋅⋅⋅pkekn=p_1^{e_1}p_2^{e_2}\cdot\cdot\cdot p_k^{e_k} be the prime factorization of positive integer nn.

It's pretty easy to see that any divisor of nn will be of the form n=p1f1p2f2⋅⋅⋅pkfkn=p_1^{f_1}p_2^{f_2}\cdot\cdot\cdot p_k^{f_k}, where 0≤fi≤ei0\le f_i \le e_i for every ii from 11 to kk. Thus the number of divisors of nn should be

d(n)=(e1+1)(e2+1)⋅⋅⋅(ek+1)d(n) = (e_1 + 1)(e_2 + 1)\cdot\cdot\cdot(e_k+1)

since there are ei+1e_i + 1 possibilities for each fif_i.

The formula for σ(n)\sigma(n) is a bit more complicated:

σ(n)=(1+p1+p12+⋯p1e1)(1+p2+p22+⋯+p2e2)⋯(1+pk+pk2+⋯+pkek)\sigma(n) = (1 + p_1 + p_1^2 +\cdots p_1^{e_1})(1 + p_2 + p_2^2 + \cdots + p_2^{e_2}) \cdots (1 + p_k + p_k^2 + \cdots + p_k^{e_k})

In this expression there will be (e1+1)(e2+1)⋅⋅⋅(ek+1)(e_1 + 1)(e_2 + 1)\cdot\cdot\cdot(e_k+1) products formed by taking one number from each sum. Clearly, all of these products are divisors of nn and each divisor of nn is one of the products. Also, each product is unique (because prime factorizations are unique). Since the expression of the sum of all the products, we can conclude this equals the sum of the divisors of nn.

We can simplify the expression by using the formula for the sum of a geometric sequence:

σ(n)=∏i=1k(1+pi+pi2+⋯+piei)=∏i=1kpiei+1−1pi−1\sigma(n) = \prod_{i=1}^{k}(1+p_i+p_i^2+\cdots+p_i^{e_i}) = \prod_{i=1}^{k}\frac{p_i^{e_i + 1}-1}{p_i-1}

Observe that d(n)d(n) and σ(n)\sigma(n) are both multiplicative, meaning that if gcd(m,n)=1gcd(m,n)=1, then d(mn)=d(m)d(n)d(mn) = d(m)d(n) and σ(mn)=σ(m)σ(n)\sigma(mn) = \sigma(m)\sigma(n).

Euler's totient theorem, (φ\varphi, also known as phi) outputs the number of positive integers, mm, upto nn that are relatively prime to nn, i.e, gcd⁡(m,n)=1\gcd(m, n) = 1. The formula is as follows:

φ(n)=n(1−1p1)(1−1p2)…(1−1pk)\varphi(n) = n(1 - \dfrac{1}{p_1})(1 - \dfrac{1}{p_2}) \dots(1 - \dfrac{1}{p_k})

The proof for this is quite intuitive, the fraction: 1−1pi1 - \dfrac{1}{p_i} multiplied by nn gives the number of positive integers upto nn which do not have the prime pip_i in their prime factorization. Multiplying this value over all primes, pip_i, in the prime factorization of nn accumulates to give the value of the number of positive integrs upto nn which share no prime factors with nn.

Techniques

Frequently, you may run across problems asking for some manipulation of the divisor's of a number, these tools provide the most effective way to solve those problems. Simply prime factorize the number, and proceed by using the above formulas.

We can also use these formulas to find simple expressions for values such as the product of all factors of an integer: ∏(n)=nd(n)2\prod(n) = n^{\frac{d(n)}{2}}

Let all factors of an integer nn be in the set S=1,...,nS = 1, ..., n. Pair each divisor, dd, with its complement, i.e, nd\dfrac{n}{d}. Since d∣nd \mid n exactly when nd∣n\dfrac{n}{d} \mid n, this pairing maps SS to itself, and each pair has product

d⋅nd=nd \cdot \frac{n}{d} = n

There are d(n)d(n) divisors in total, so they split into d(n)2\dfrac{d(n)}{2} such pairs. Multiplying the products of all pairs together gives

∏(n)=∏d∣nd=nd(n)2\prod(n) = \prod_{d \mid n} d = n^{\frac{d(n)}{2}}

When nn is a perfect square, n\sqrt{n} is a divisor that pairs with itself, so d(n)d(n) is odd and the exponent d(n)2\dfrac{d(n)}{2} is not an integer. The formula still holds: writing nd(n)2=nd(n)−12⋅nn^{\frac{d(n)}{2}} = n^{\frac{d(n)-1}{2}} \cdot \sqrt{n}, the first term accounts for the d(n)−12\dfrac{d(n)-1}{2} genuine pairs and the n\sqrt{n} accounts for the self-paired divisor.

Euler's Totient Function also has various uses in number theory, specifically, Fermat's Little Theorem which states:

ap−1≡1(a^{p-1} \equiv 1 (mod p)p)

where pp is a prime and pp does not divide aa. The proof for this is beyond the scope of the module, but you may reference this.

Examples

For how many positive integers n≤1000n \le 1000 is d(n)d(n) odd?

Solution

Looking at the formula d(n)=(e1+1)(e2+1)⋅⋅⋅(ek+1)d(n) = (e_1 + 1)(e_2 + 1)\cdot\cdot\cdot(e_k+1), we see that for d(n)d(n) to be odd, each ei+1e_i + 1 term must be odd. In other, all of the exponents of nn must be even, which is equivalent to saying that nn is a perfect square. So the answer is 31\boxed{31}, since there are that many perfect squares under 10001000.

In other words, d(n)d(n) is odd if and only if nn is a perfect square, which is a useful fact.

Find the smallest number with exactly 14 positive divisors.

Solution

Using the formula for d(n)d(n), we see that any number with exactly 14 positive divisors must be of the form p13p^{13} or p6⋅qp^6\cdot q, where p,qp,q are primes. It's easy to see that the smallest number of either form is 26⋅3=1922^6\cdot 3=\boxed{192}.

2021 Fall AMC 12B · Problem 12 For nn a positive integer, let f(n)f(n) be the quotient obtained when the sum of all positive divisors of nn is divided by n.n. For example, f(14)=1+2+7+1414=127f(14) = \dfrac{1 + 2 + 7 + 14}{14} = \dfrac{12}{7}. What is f(768)−f(384)f(768) - f(384)?

(A) 1768(B) 1192(C) 1(D) 43(E) 83\textbf{(A)}\ \dfrac{1}{768} \qquad\textbf{(B)}\ \dfrac{1}{192} \qquad\textbf{(C)}\ 1 \qquad\textbf{(D)}\ \dfrac{4}{3} \qquad\textbf{(E)}\ \dfrac{8}{3}

Solution

Notice that f(n)=σ(n)nf(n) = \dfrac{\sigma(n)}{n}, so we can apply the formula for σ(n)\sigma(n) directly after prime factorizing. The prime factorizations are 768=28⋅3768 = 2^8 \cdot 3 and 384=27⋅3384 = 2^7 \cdot 3.

Using σ(n)=∏i=1kpiei+1−1pi−1\sigma(n) = \prod_{i=1}^{k}\dfrac{p_i^{e_i + 1}-1}{p_i-1}, we get

σ(768)=29−12−1⋅32−13−1=511⋅4=2044\sigma(768) = \frac{2^9 - 1}{2 - 1} \cdot \frac{3^2 - 1}{3 - 1} = 511 \cdot 4 = 2044
σ(384)=28−12−1⋅32−13−1=255⋅4=1020\sigma(384) = \frac{2^8 - 1}{2 - 1} \cdot \frac{3^2 - 1}{3 - 1} = 255 \cdot 4 = 1020

Therefore

f(768)−f(384)=2044768−1020384=511192−510192=1192f(768) - f(384) = \frac{2044}{768} - \frac{1020}{384} = \frac{511}{192} - \frac{510}{192} = \boxed{\frac{1}{192}}

so the answer is (B)\textbf{(B)}.

Practice Problems

StatusSourceProblem NameDifficultyTags

Module Progress:

Join the Discord Community!

Stuck on a problem, or don't understand a module? Join the Discord and get help with your doubts while making more math friends.