MathCompass

Number Theoretic Functions

Number Theory Advanced

📋 Prerequisites

Number-theoretic functions take integers as input and spit out integers. The big ones — tau (divisor count), sigma (divisor sum), and phi (Euler's totient) — are all multiplicative, meaning you can compute them from prime factorizations by multiplying per-prime values. We unify everything under the multiplicative function framework, then introduce the Möbius function and its surprising role.

📚 Key Concepts

Multiplicative Functions

A function $f$ is multiplicative if whenever gcd(m, n) = 1:

\[ f(mn) = f(m) \cdot f(n) \]

Completely multiplicative: $f(mn) = f(m)f(n)$ for ALL m, n (no gcd condition).

Why this matters: if you know the prime factorization $n = \prod p_i^{a_i}$, then for any multiplicative function:

\[ f(n) = \prod f(p_i^{a_i}) \]

Just compute f on each prime power and multiply! This is why prime factorization is the universal key.

τ(n) — Number of Divisors

Also written d(n) or τ(n). Counts positive divisors of n.

\[ \tau(n) = \prod_{i=1}^{k} (a_i + 1) \quad \text{where } n = \prod p_i^{a_i} \]

On prime powers: $ \tau(p^a) = a + 1 $

Multiplicative: Yes, τ is multiplicative (but not completely).

Example: τ(12) = τ\(((2^{2} \\times 3^{1})\) = (2+1)(1+1) = 6. Divisors: {1,2,3,4,6,12}\) ✓

σ(n) — Sum of Divisors

Sum of all positive divisors of n.

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

On prime powers: $ \sigma(p^a) = 1 + p + p^2 + ... + p^a = \frac{p^{a+1}-1}{p-1} $ (geometric series)

Multiplicative: Yes, σ is multiplicative.

Example: σ(12) = σ\(((2^{2}) \\times\)\) σ\(((3^{1}) = (1+2+4)(1+3) = 7 \\times\) 4 = 28\) ✓

φ(n) — Euler's Totient Function

Counts integers from 1 to n that are coprime to n.

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

On prime powers: $ \varphi(p^a) = p^a - p^{a-1} = p^{a-1}(p-1) = p^a(1 - 1/p) $

Multiplicative: Yes, φ is multiplicative.

Example: φ(12) = φ\(((2^{2}) \\times\)\) φ\(((3^{1}) = 2 \\times\) 2 = 4. Coprime to 12: {1, 5, 7, 11}\) ✓

Perfect, Abundant, Deficient Numbers

Classify n based on σ(n) vs 2n (or equivalently, sum of proper divisors vs n):

Euclid-Euler Theorem: Every even perfect number has the form $ 2^{p-1}(2^p - 1) $ where $2^p - 1$ is a Mersenne prime. No odd perfect numbers are known.

Möbius Function μ(n)

Defined as:

Examples:

Multiplicative: Yes, μ is multiplicative.

Möbius Inversion (Intro)

If $ g(n) = \sum_{d|n} f(d) $ for all n, then:

\[ f(n) = \sum_{d|n} \mu(d) \cdot g\left(\frac{n}{d}\right) \]

This is the "inclusion-exclusion of number theory." It lets you invert sum-over-divisors relationships.

Example: since $ n = \sum_{d|n} \varphi(d) $, Möbius inversion gives $ \varphi(n) = \sum_{d|n} \mu(d) \cdot \frac{n}{d} $.

Important Summatory Relationships

⚠️ Common Mistake: Multiplicative means f(mn) = f(m)f(n) only when gcd(m,n) = 1. It does NOT mean f(mn) = f(m)f(n) always — that's "completely multiplicative." Don't assume φ(ab) = φ(a)φ(b) when a and b share factors! For example, φ(4) = 2, φ(2) = 1, but φ\((4) \\neq\) φ\((2) \\times\) φ\((2) because gcd(2,2) \\neq 1. Also:\) μ(n) is zero whenever n has any squared prime factor — always check for squares first.
💡 Key Insight: Multiplicativity is the unifying theme. All the important number-theoretic functions are multiplicative, which means prime factorization unlocks everything. Memorize the per-prime-power formulas: τ\((p^{a}) = a+1, σ(p^{a}) = (p^{a+}\(^{1}-1)/\)(p-1), φ(p^{a}) = p^{a} - p^{a-}\(^{1}.\) Then for any n, factor it, compute each prime power value,\) multiply them together. This one framework replaces three separate formulas.

✏️ Example Problems

📝 Example 1 (Sum of divisors)

What is the sum of all positive divisors of 60?

Step 1: Prime factorization.

\(60 = 2^{2} \\times 3^{1} \\times 5^{1}\)

Step 2: σ is multiplicative. Compute σ on each prime power.

σ\((2^{2})\) = 1 + 2 + 4 = 7

σ\((3^{1})\) = 1 + 3 = 4

σ\((5^{1})\) = 1 + 5 = 6

Step 3: Multiply them together.

\[ \sigma(60) = \sigma(2^2) \times \sigma(3) \times \sigma(5) = 7 \times 4 \times 6 = 168 \]

Verify: Divisors of 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60

Sum = 1+2+3+4+5+6+10+12+15+20+30+60 = 168 ✓

Answer: 168

📝 Example 2 (Euler's totient)

Compute φ(100). How many numbers from 1 to 100 are coprime to 100?

Step 1: Prime factorization of 100.

\(100 = 2^{2} \\times 5^{2}\)

Step 2: φ is multiplicative. Compute on each prime power.

φ\((2^{2}) = 2^{2} - 2^{1}\) = 4 - 2 = 2

φ\((5^{2}) = 5^{2} - 5^{1}\) = 25 - 5 = 20

Step 3: Multiply.

\[ \varphi(100) = \varphi(2^2) \times \varphi(5^2) = 2 \times 20 = 40 \]

Alternative formula check:

φ\((100) = 100 \\times (1 - \\frac{1}{2}) \\times (1 - \\frac{1}{5}) = 100 \\times \\frac{1}{2} \\times\) ⅘ \(= 100 \\times\) ⅖ = 40 ✓

Intuition: Half the numbers are odd (not divisible by 2), and 4/5 aren't divisible by 5. \(\\frac{1}{2} \\times\) ⅘ = ⅖ of 100 = 40 numbers.

Answer: 40

📝 Example 3 (Möbius function)

What is μ(30)? (Möbius function of 30)

Step 1: Prime factorization of 30.

\(30 = 2 \\times 3 \\times 5\)

Step 2: Check if square-free.

All exponents are 1. No squared primes. Square-free: yes.

Step 3: Count prime factors.

Three distinct prime factors (2, 3, 5).

Step 4: Apply Möbius definition.

\(Square-free + odd number of primes \\to\) μ(n) = -1

\[ \mu(30) = -1 \]

More practice:

  • μ(1) = 1 (0 primes, even count)
  • μ(6) = μ\((2 \\times 3) = 1 (2 primes, even)\)
  • μ(12) = μ\(((2^{2} \\times\) 3) = 0 (has square factor 2^{2})\)

Answer: -1

Previous
Next