Chapter

Arithmetic Functions

This module develops work with \(\tau(n)\), \(\sigma(n)\), \(\varphi(n)\), multiplicativity, and problems about the structure of prime divisors.
Log in to track solved progress and bookmarks.

Theory

Key Idea

Arithmetic functions translate the prime factorisation of a number into computable quantities: the number of divisors \(\tau(n)\), the sum of divisors \(\sigma(n)\), Euler's function \(\varphi(n)\), and the number of distinct prime divisors \(\omega(n)\).

The olympiad strength of these functions is that they often turn a problem about \(n\) into a problem about the exponents in \(n=p_1^{a_1}\cdots p_r^{a_r}\).

Basic Facts

If \(n=p_1^{a_1}\cdots p_r^{a_r}\), then \(\tau(n)=(a_1+1)\cdots(a_r+1)\).

\[\sigma(n)=\prod_{i=1}^{r}\frac{p_i^{a_i+1}-1}{p_i-1}.\]

\[\varphi(n)=n\prod_{p\mid n}\left(1-\frac{1}{p}\right).\]

The functions \(\tau,\sigma,\varphi\) are multiplicative: if \(\gcd(a,b)=1\), then \(f(ab)=f(a)f(b)\) for each of them.

A classical identity is \(\sum_{d\mid n}\varphi(d)=n\).

When To Use This Method

Use arithmetic functions when a problem mentions the number of divisors, the sum of divisors, coprimality with \(n\), perfect or abundant numbers, or asks to find all \(n\) satisfying conditions such as \(\varphi(n)=cn\), \(\tau(n)=k\), or oddness of \(\sigma(n)\).

How To Recognise The Method

If a condition depends only on divisors or prime factors, write the canonical factorisation of \(n\). If \(\varphi(n)/n\) appears, look at the set of prime divisors rather than the exponents.

Typical Mistakes

Do not confuse multiplicativity with complete multiplicativity: usually \(f(ab)=f(a)f(b)\) is true only when \(\gcd(a,b)=1\).

For \(\sigma(n)\), remember that \(\sigma(p^a)=1+p+\cdots+p^a\), not just \(p^a+1\). For \(\varphi(n)\), prime exponents affect \(n\), but the ratio \(n/\varphi(n)\) depends only on the distinct primes.

Mini-Checklist

1. Is \(n\) written as a product of prime powers?

2. Is a formula for \(\tau\), \(\sigma\), or \(\varphi\) needed?

3. Can multiplicativity be used?

4. In a “find all” problem, which prime factors can occur at all?

5. Have the small cases \(n=1,2\) been checked?

Examples

Example 1. Computation From Factorisation

First factor the number into prime powers.

Problem. Find \(\tau(360)\), \(\sigma(360)\), \(\varphi(360)\).

Solution.

\(360=2^3\cdot 3^2\cdot 5\). Thus \(\tau(360)=4\cdot 3\cdot 2=24\). Also \(\sigma(360)=(1+2+4+8)(1+3+9)(1+5)=15\cdot 13\cdot 6=1170\). Finally, \(\varphi(360)=360\left(1-\frac12\right)\left(1-\frac13\right)\left(1-\frac15\right)=96\).

Example 2. Multiplicativity of \(\tau\)

A divisor of a product of coprime numbers splits uniquely into two divisors.

Problem. Prove that if \(\gcd(a,b)=1\), then \(\tau(ab)=\tau(a)\tau(b)\).

Solution.

Every divisor \(d\mid ab\) can be written uniquely as \(d=d_1d_2\), where \(d_1\mid a\), \(d_2\mid b\). Conversely, every such pair gives a divisor of \(ab\). Therefore the number of divisors equals the number of pairs \((d_1,d_2)\), namely \(\tau(a)\tau(b)\).

Example 3. The Sum of \(\varphi\)

The identity \(\sum_{d\mid n}\varphi(d)=n\) is best understood through reduced fractions.

Problem. Prove that \(\sum_{d\mid n}\varphi(d)=n\).

Solution.

Partition the numbers \(1,2,\ldots,n\) by \(d=\frac{n}{\gcd(k,n)}\). Then \(d\mid n\), and after dividing by \(\gcd(k,n)\), the number \(k\) gives a residue coprime to \(d\). For a fixed \(d\), there are exactly \(\varphi(d)\) such numbers \(k\). All \(n\) numbers are counted, so the sum is \(n\).

Example 4. When \(\varphi(n)=n/2\)

The ratio \(n/\varphi(n)\) depends only on distinct prime divisors.

Problem. Find all \(n\) such that \(\varphi(n)=\frac{n}{2}\).

Solution.

The condition is equivalent to \(\frac{n}{\varphi(n)}=2\). But \(\frac{n}{\varphi(n)}=\prod_{p\mid n}\frac{p}{p-1}\). If an odd prime \(p\mid n\), the product gets a factor with odd numerator and even denominator, and it is not equal to \(2\). The only possible prime divisor is \(2\). Hence \(n=2^a\), \(a\ge 1\), and all such \(n\) work.

Example 5. Odd Number of Divisors

Divisors usually pair as \(d\) and \(n/d\).

Problem. Prove that \(\tau(n)\) is odd if and only if \(n\) is a square.

Solution.

If \(d\ne n/d\), the divisors \(d\) and \(n/d\) form a pair. An unpaired divisor can occur only when \(d=n/d\), that is \(d^2=n\). Therefore an odd number of divisors occurs exactly for squares.

Example 6. All Numbers With 12 Divisors

The problem reduces to factoring \(12\) into factors \(a_i+1\).

Problem. Describe all \(n\) such that \(\tau(n)=12\).

Solution.

If \(n=\prod p_i^{a_i}\), then \(\prod(a_i+1)=12\). The possible exponent types are \(11\); \(5,1\); \(3,2\); \(2,1,1\). Hence \(n\) has one of the forms \(p^{11}\), \(p^5q\), \(p^3q^2\), \(p^2qr\), where \(p,q,r\) are distinct primes.

Example 7. Sum of Coprime Residues

Residues coprime to \(n\) pair as \(a\) and \(n-a\).

Problem. Prove that for \(n>1\), the sum of positive integers \(a\le n\) coprime to \(n\) is \(\frac{n\varphi(n)}{2}\).

Solution.

If \(\gcd(a,n)=1\), then \(\gcd(n-a,n)=1\). The pair \(a\) and \(n-a\) has sum \(n\). There is no self-paired residue: \(a=n-a\) would give \(2a=n\), but then \(\gcd(a,n)>1\) for \(n>2\), and \(n=2\) is checked directly. There are \(\varphi(n)\) residues, so the sum is \(\frac{n\varphi(n)}{2}\).

Example 8. Composite Numbers and \(\sigma\)

Sometimes several obvious divisors are enough.

Problem. Prove that if \(n\) is composite, then \(\sigma(n)>n+\sqrt{n}\).

Solution.

Let \(d\) be the smallest divisor of \(n\) greater than \(1\). Then \(d\le \sqrt{n}\), and \(\frac{n}{d}\ge \sqrt{n}\). The numbers \(1,n,d,\frac{n}{d}\) are divisors of \(n\). Hence \(\sigma(n)\ge n+1+d+\frac{n}{d}>n+\sqrt{n}\).

Problems

Problems

#10.1
#10.1

Compute the Functions

Divisors Grade 9 Grade 10 ★★☆☆☆

Compute \(\tau(540)\), \(\sigma(540)\), \(\varphi(540)\).

Details
Problem: NT-B2-M10-P001
Difficulty: Level 2 of 5
Tag: Divisors
Grade: Grade 9, Grade 10
#10.2
#10.2

Number of Divisors

Divisors Grade 9 Grade 10 ★★☆☆☆

Find all natural numbers \(n=2^a3^b\) that have exactly \(18\) positive divisors.

Details
Problem: NT-B2-M10-P002
Difficulty: Level 2 of 5
Tag: Divisors
Grade: Grade 9, Grade 10
#10.3
#10.3

Multiplicativity of Sum of Divisors

Arithmetic Functions Grade 9 Grade 10 ★★☆☆☆

Prove that if \(\gcd(a,b)=1\), then \(\sigma(ab)=\sigma(a)\sigma(b)\).

Details
Problem: NT-B2-M10-P003
Difficulty: Level 2 of 5
Tag: Arithmetic Functions
Grade: Grade 9, Grade 10
#10.4
#10.4

Parity of Euler's Function

Arithmetic Functions Grade 9 Grade 10 ★★☆☆☆

Prove that for \(n>2\), the number \(\varphi(n)\) is even.

Details
Problem: NT-B2-M10-P004
Difficulty: Level 2 of 5
Tag: Arithmetic Functions
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 523
#10.5
#10.5

The Sum of \(\varphi(d)\)

Arithmetic Functions Grade 9 Grade 10 ★★★☆☆

Prove that for every \(n\ge 1\), \(\sum_{d\mid n}\varphi(d)=n\).

Details
Problem: NT-B2-M10-P005
Difficulty: Level 3 of 5
Tag: Arithmetic Functions
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 448
#10.6
#10.6

When \(\varphi(n)=n/2\)

Arithmetic Functions Grade 9 Grade 10 ★★★☆☆

Find all positive \(n\) such that \(\varphi(n)=\frac{n}{2}\).

Details
Problem: NT-B2-M10-P006
Difficulty: Level 3 of 5
Tag: Arithmetic Functions
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 731
#10.7
#10.7

When \(\varphi(n)=n/3\)

Arithmetic Functions Grade 9 Grade 10 ★★★☆☆

Find all positive \(n\) such that \(\varphi(n)=\frac{n}{3}\).

Details
Problem: NT-B2-M10-P007
Difficulty: Level 3 of 5
Tag: Arithmetic Functions
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 733
#10.8
#10.8

When \(\varphi(n)=2n/5\)

Arithmetic Functions Grade 9 Grade 10 ★★★☆☆

Find all positive \(n\) such that \(\varphi(n)=\frac{2n}{5}\).

Details
Problem: NT-B2-M10-P008
Difficulty: Level 3 of 5
Tag: Arithmetic Functions
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 732
#10.9
#10.9

Odd \(\sigma(n)\)

Divisors Grade 9 Grade 10 ★★★☆☆

Prove that \(\sigma(n)\) is odd if and only if \(n\) is a square or twice a square.

Details
Problem: NT-B2-M10-P009
Difficulty: Level 3 of 5
Tag: Divisors
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 487
#10.10
#10.10

Prime Sum of Divisors

Divisors Grade 9 Grade 10 ★★★☆☆

Prove that if \(\sigma(n)\) is prime, then \(\tau(n)\) is also prime.

Details
Problem: NT-B2-M10-P010
Difficulty: Level 3 of 5
Tag: Divisors
Grade: Grade 9, Grade 10
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 486
#10.11
#10.11

Exactly 14 Divisors

Divisors Grade 10 Grade 11 ★★★★☆

Describe all natural numbers that have exactly \(14\) positive divisors.

Details
Problem: NT-B2-M10-P011
Difficulty: Level 4 of 5
Tag: Divisors
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 475
#10.12
#10.12

Divisibility of Prime-Power Sums

Divisors Grade 10 Grade 11 ★★★★☆

Let \(p\) be prime and \(a,b\ge 0\). Prove that \(\sigma(p^a)\mid \sigma(p^b)\) if and only if \(a+1\mid b+1\).

Details
Problem: NT-B2-M10-P012
Difficulty: Level 4 of 5
Tag: Divisors
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 498
#10.13
#10.13

Divisibility \(\varphi(m)\mid\varphi(n)\)

Arithmetic Functions Grade 10 Grade 11 ★★★★☆

Prove that if \(m\mid n\), then \(\varphi(m)\mid\varphi(n)\).

Details
Problem: NT-B2-M10-P013
Difficulty: Level 4 of 5
Tag: Arithmetic Functions
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 525
#10.14
#10.14

When \(\varphi(n)\mid n\)

Arithmetic Functions Grade 10 Grade 11 ★★★★☆

Find all positive \(n\) such that \(\varphi(n)\mid n\).

Details
Problem: NT-B2-M10-P014
Difficulty: Level 4 of 5
Tag: Arithmetic Functions
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 526
#10.15
#10.15

Sum of Coprime Integers

Arithmetic Functions Grade 10 Grade 11 ★★★★☆

Prove that for \(n>1\), the sum of all positive \(a\le n\) coprime to \(n\) equals \(\frac{n\varphi(n)}{2}\).

Details
Problem: NT-B2-M10-P015
Difficulty: Level 4 of 5
Tag: Arithmetic Functions
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 531
#10.16
#10.16

Product of Divisors

Divisors Grade 10 Grade 11 ★★★★☆

Prove that the product of all positive divisors of \(n\) is \(n^{\tau(n)/2}\).

Details
Problem: NT-B2-M10-P016
Difficulty: Level 4 of 5
Tag: Divisors
Grade: Grade 10, Grade 11
#10.17
#10.17

Sum of Squares of Divisors

Divisors Grade 10 Grade 11 ★★★★★

Prove that for every \(n\ge 1\), \(\sigma_2(n)\ge n\tau(n)\), where \(\sigma_2(n)=\sum_{d\mid n}d^2\).

Details
Problem: NT-B2-M10-P017
Difficulty: Level 5 of 5
Tag: Divisors
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 489
#10.18
#10.18

Composite Numbers Have Large Divisor Sum

Bounds Grade 10 Grade 11 ★★★★★

Prove that if \(n\) is composite, then \(\sigma(n)>n+\sqrt{n}\).

Details
Problem: NT-B2-M10-P018
Difficulty: Level 5 of 5
Tag: Bounds
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 617
#10.19
#10.19

A Power of Two in \(\varphi(n)\)

Prime Factorisation Grade 10 Grade 11 ★★★★★

Let \(n>1\), and let \(\omega(n)\) be the number of distinct prime divisors of \(n\). Prove that \(2^{\omega(n)-1}\mid \varphi(n)\).

Details
Problem: NT-B2-M10-P019
Difficulty: Level 5 of 5
Tag: Prime Factorisation
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 532
#10.20
#10.20

Prime If and Only If

Prime Factorisation Grade 10 Grade 11 ★★★★☆

Prove that \(n\ge 2\) is prime if and only if \(\varphi(n)=n-1\).

Details
Problem: NT-B2-M10-P020
Difficulty: Level 4 of 5
Tag: Prime Factorisation
Grade: Grade 10, Grade 11
Source: 1001 Problems in Classical Number Theory (method inspiration) · Problem 729

Ladders

No published ladders were found.
Previous Chapter
Next Chapter