Number Theory

Table of Contents

1. Greatest Common Divisor

1.1. Defintion

  • \[ \gcd(a,b) := \max\{d \mid d|a \land d|b\} \]
  • \[ \gcd(a,0) = \gcd(0,a) := |a| \]
    • \(0\) divided by any number has remainder \(0\).

1.2. Properties

  • It is commutative: \(\gcd(a,b) = \gcd(b,a)\).
  • It is associative: \(\gcd(a, \gcd(b,c)) = \gcd(\gcd(a,b), c)\)
    • \(\gcd(a,b,c)\) is well defined.
  • It is multiplicative for coprimes: \(\gcd(a_1a_2, b) = \gcd(a_1, b)\gcd(a_2,b)\) if \(a_1\) and \(a_2\) are relatively prime.
  • \[ \def\gcd{\operatorname{gcd}} \gcd(a,b) = \gcd(a, b - a) \]
  • \[ \gcd(a,b){\operatorname{lcm(a,b)}} = |ab| \]

1.3. Calculation

1.3.1. Euclidean Algorithm

  • Euclid's Algorithm
1.3.1.1. Algorithm
  • Let \(r_{-2} = a\) and \(r_{-1} = b\). logseq.order-list-type:: number
  • Recursively calculate \(r_k\) with \(r_{k-2} = q_kr_{k-1} + r_k\). logseq.order-list-type:: number
  • The last nonzero remainder is the greatest common divisor of \(a\) and \(b\). logseq.order-list-type:: number
    • Due to the fact that: \[ \def\gcd{\operatorname{gcd}} \gcd(a,b) = \gcd(a, b-na) \] for all \(n\in \mathbb{Z}\).
      • The case \(a = 0\) or \(b=0\) is defined in a way so that this relation holds.
    • Consequently: \[ \def\gcd{\operatorname{gcd}} \gcd(a,b) = \gcd(a, b\text{ mod $a$}) \]
1.3.1.2. Properties
  • The quotients \(q_k\) naturally form a continued fraction:
    • \[ \frac{a}{b} = q_0 + \dfrac{1}{q_1 + \dfrac{1}{\ddots + \dfrac{1}{q_n}}} = q_0 + \operatorname*{\rm\Large K}\limits_{k=1}^n \frac{1}{q_k}. \]

1.3.2. Binary GCD Algorithm

  • Stein's Algorithm, Binary Euclidean algorithm
  • It uses the following identities of the GCD:
    • \(\gcd(u, 0) = u\) logseq.order-list-type:: number
    • \(\gcd(2u, 2v) = 2\gcd(u,v)\) logseq.order-list-type:: number
    • \(\gcd(u,2v) = \gcd(u,v)\) logseq.order-list-type:: number
    • \(\gcd(u,v) = \gcd(u, v-u)\) logseq.order-list-type:: number
1.3.2.1. Algorithm
  • Divides both \(u\) and \(v\) by 2 at the same time until one of them becomes odd, and record the number of division \(d\).
  • Divide by 2 either \(u\) or \(v\) until they both becomes odd.
  • Subtract the lesser from the larger once, and divide the result until it becomes odd.
  • Repeat until they are equal \(a\). The greatest common divisor is \(2^da\).

1.3.3. Lehmer's GCD Algorithm

1.4. Least Common Multiple

It can be calculated from the greatest common divisor with \[ \operatorname{lcm}(a, b) = \frac{|ab|}{\operatorname{gcd}(a,b)}. \]

2. Divisibility Rule

2.1. 3

2.1.1. Digit Sum Method

  • Add every digit and see if it is divisible by 3.
  • If it is still large one can repeat it.
  • It preserves the remainder since only subtractions are performed.

2.2. 7

  • 21, 49, 1001 method removes the factor of 10 each time, shifting the remainder.
  • while it is not the case for 98 method and modulo method.

2.2.1. 21 Method

  • James' Method
  1. Remove the one's digit ( \( -x \) )
  2. Sutract two times the one's digit from the remaining ( \( -20x \) )

2.2.2. 49 Method

  • Michael's Method
  1. Remove the one's digit ( \(- x \) )
  2. Add five times the one's digit to the remaining ( \( + 50x \) )

2.2.3. 98 Method

  • Matt's Method
  1. Take all the most significant digits starting from the thrid position ( \( -100x \) )
  2. Add twice of that back to the first position ( \( +2x \) )
  • It preserves the remainder.

2.2.4. 1001 Method

Make use of the fact that \( 1001 = 7 \times 143 \)

  1. Remove the last three digits ( \( -x \) )
  2. Subtract it from the remaining ( \( -1000 x \) )

2.2.5. Modulo Method

  1. Start at 0
  2. March clockwise with the amount of the leading digit
  3. Follow the arrow, and march with the amount of the next digit
  4. Repeat until the number is exhausted
  5. The result is the remainder upon division by 7

3. Totative

3.1. Definition

A totative of a positive integer \( n \) is a coprime \( k \) of \( n \), such that \( 0< k \le n \).

4. Divisor Function

4.1. Definition

  • For a complex number \(z\), \[ \sigma_z(n) := \sum_{d|n}d^z \]

4.2. Properties

  • It is multiplicative: If two integer \(a, b\) are coprime, \(\sigma_z(ab) = \sigma_z(a)\sigma_z(b)\).
  • \[ \sigma_z(n) = \prod_{i=1}^r\sum_{j=1}^{a_i}p_i^{jz} \]
    • where \(n=\prod_{i=1}^rp_i^{a_i}\) is the prime factorization.

5. Special Integers

5.2. Perfect Number

  • The perfect number is the stable point of the Aliquot sequence.

5.3. Amicable Number

  • Repeating aliquot sequence of period 2.

5.4. Sociable Number

  • Has repeating aliquot sequence of period 3 or greater.

5.5. Aspiring Number

  • A number that converges to the perfect number, along an Aliquot sequence.

5.6. Aliquot Sum

  • \[ s(n) := \sum_{d|n, d\neq n} d \]
  • In terms of the divisor function \( s(n) = \sigma_1(n) - n \).

5.7. Aliquot Sequence

  • Starting with a positive integer \(k\), the next term is the sum of proper divisors of the previous term.

6. Partition of a Set

6.1. Definition

Set of disjoint nonempty subsets of a set that covers the set.

6.2. Properties

  • Every equivalence relation on a set defines a partition of the set

6.3. Mesh

Or norm, \( \| P \| \)

The length of the longest subset.

7. Stirling Numbers

7.1. Unsigned First Kind

  • \[ \left[\vphantom{1}n \atop k\right] \]

7.1.1. Properties

  • \[ \left[n+1 \atop k\right] = n\left[\vphantom{0}n \atop k\right] + \left[n \atop k-1\right] \]

7.2. Second Kind

  • \[ \left\{\vphantom{1}n \atop k\right\} \]

7.2.1. Definition

The number of ways to cover the set \( [n] \) with \( k \) disjoint subsets, with the understanding that:

\begin{align*} \left\{\vphantom{1}n \atop k\right\} = \begin{cases} 0 & \text{if $n< k$}, \\ 1 & \text{if $n=k$ or $k=1$ with $n \ge 1$}, \\ 1 & \text{if $n=k=0$}. \end{cases} \end{align*}

7.2.2. Properties

  • \[ \left\{\vphantom{1}n \atop k\right\} = k\left\{n-1 \atop k\right\} + \left\{n-1 \atop k-1\right\} \]
    • Include the element as parts of other sets, or exclude an element as a singleton set.
  • \[ B_n = \sum_{k=0}^n\left\{\vphantom{1}n \atop k\right\} \] where \(B_n\) is the Bell numbers
  • \[ \left\{\vphantom{1}n \atop n-1\right\} = \binom{n}{2} \]
  • \[ \left\{\vphantom{1}n \atop 2\right\} = 2^{n-1} - 1 \]
  • \( k!\left\{\vphantom{1}n \atop k\right\} \) counts the number of surjective functions of the form \( f: [n] \to [k] \).
  • \[ \left\{\vphantom{1}n \atop k\right\} = \frac{1}{k!} \sum_{j=0}^k(-1)^j\binom{k}{j}(k-j)^n = \sum_{j=0}^k(-1)^j \frac{(k-j)^n}{j!(k-j)!} \]

8. Bell Numbers

  • \(B_n\)

8.1. Definition

9. Pair Partition

9.1. Definition

The number of ways to divide a set into disjoint subsets of size two.

\[ \mathrm{PairPartition}(n) = \begin{cases} n!! & \text{if $n$ is even,}\\ 0 & \text{if $n$ is odd.} \end{cases} \]

10. Bézout's Identity

10.1. Statement

  • For two integers \(a,b\) with greatest common divisor \(d\), there exists integers \(x,y\) such that:
    • \[ ax+by = d \]
  • Moreover, the integers of the form \(az+bt\) are exactly the multiples of \(d\).

10.2. Corrollary

  • For a prime \(p\), and a positive integer \(a < p\), there exists an integer \(b\) such that:
    • \[ pq + ba = 1. \]
  • Furthermore, by taking modulo \(p\), it follows that:
    • \[ ba \equiv 1 \pmod{p} \implies [b]\cdot [a] = [1] \]

11. Fermat's Little Theorem

11.1. Statement

  • For all \( a\in\mathbb{Z} \) and primes \(p\), \( p\mid a^p-a \).
  • Equivalently \[ a^{p-1}\equiv 1 \pmod{p}. \]

11.2. Proofs

11.2.1. Special Case of Euler's Theorem

  • Notice the bijection, and set equality between \( x \leftrightarrow a\cdot x \) under modulo \(p\).
  • Multiplying modulo \(p\) every elements of each set yields:
    • \[ \prod_{i=1}^{p-1}(ia) \equiv \prod_{i=1}^{p-1}i \pmod{p} \]
    • Dividing both side by \( \prod_{i=1}^{p-1}i \), which is allows since it is not divisible by \(p\), immediately gives the Fermat's little theorem.

11.2.2. p-Letter Words1

11.2.2.1. Lemma
  • \( w \) is a \(p\)-letter word from any alphabet with at least two character \( \implies \) Every cyclic permutation of \( w \) are distinct.
  • This is quite clear because if any non-identity permutation was the same, then it would imply that \(p\) is not a prime.
    • If \( a,b\in\mathbb{Z} \) are coprimes, then \( \forall m,\exists n,\ a^n\equiv m\mod{b} \) and \( \forall m,\exists n,\ b^n\equiv m\mod{a} \).
11.2.2.2. Proof
  • In an alphabet \(A\) of size \(a\), every \(p\)-letter word are split into two groups: either it consists of all the same letter, or it stays distinct under cyclic permutations.
  • Note that the size of the set of every word is \( a^p \); now it is immediately obvious that \( p\mid a^p-a \). \( \square \)

11.2.3. Necklaces2

  • Count the number of necklaces distinct up to rotation and not all the same color.
  • Counting necklaces

11.3. Carmichael numbers

  • pseudoprimes

11.3.1. Definition

  • It is a composite number \(c\), such that \( c\mid a^c-a \) for all integer \( a \).
  • Despite the existence of Carmichael numbers, Fermat's little theorem is a useful tool for recognizing primes.

12. Euler's Theorem

12.1. Statement

  • \[ a^{\varphi(n)} \equiv 1\pmod{n} \] where \(n\) and \(a\) are coprime and \(\varphi(n)\) is the Euler's totient function.

13. Chinese Remainder Theorem

13.1. Statement

  • If the remainders of an integer \(n\), when divided by pairwise coprime integers, are known, The remainder of \(n\), when divided by the products of the divisors, is uniquely determined.
  • Equivalently, the map \[ x\mod{\left(\prod n_i\right)} \mapsto (x\mod {n_1},\dots,x\mod{n_k}) \] defines a ring isomorphism \[ \mathbb{Z}/N\mathbb{Z} \cong \mathbb{Z}/n_1\mathbb{Z} \times \cdots \times \mathbb{Z}/n_k\mathbb{Z}. \]

13.2. History

  • Fisrt appear in 孫子算經 from the third century, although it does not contain the proof nor the algorithm.

14. Euler's Totient Function

  • Euler's Phi Function

14.1. Definition

  • The number of coprimes of a positive integer \(n\) up to \(n\). Aka totative. It includes \(1\).
    • An integer is not coprime of itself, except 1.

14.2. Properties

  • It is multiplicative: \( \varphi(m)\varphi(n) = \varphi(mn) \), if \(m\) and \(n\) are relatively prime.
  • \( \varphi(p^k) = p^{k-1}(p-1) \), since it counts all the number below \( p^k \) that is not a multiple of \(p\).

14.3. Euler's Product Formula

  • \[ \varphi(n) = n\prod_{p\mid n}\left(1-\frac{1}{p}\right) \]
    • where \(p\) is prime.
  • Equivalently, \[ \varphi(n) = \prod_{i=1}^rp_i^{k_i-1}(p_i-1) = p_1^{k_1-1}(p_1{-}1)\,p_2^{k_2-1}(p_2{-}1)\cdots p_r^{k_r-1}(p_r{-}1) \]
    • where \( n = \prod_{i=1}^r p_i^{k_i} \) is the prime factorization of \(n\).

14.4. Divisor Sum

  • \[ \sum_{d|n}\varphi(d) = n \]
  • \( \varphi(d) \) with \( d|n \) counts the number of generator of \( C_d \) that is a subgroup of \( C_n \). Since every element of \( C_n \) generate a cyclic subgroup of \( C_n \), they sum to the same number. (\( C_n \) being the \( \mathbb{Z}/n\mathbb{Z} \)).
  • Applying the Möbius inversion formula,
    • \[ \varphi(n) = \sum_{d|n}\mu(d)\frac{n}{d} \]

14.5. Menon's Identity

  • \[ \sum_{\begin{smallmatrix}1\le k\le n\\[.2em] \gcd(k,n)=1\end{smallmatrix}}\gcd(k-1,n) = \varphi(n)d(n) \]
    • where \( d(n) \) is the number of divisor of \(n\).
    • equivalently, the divisor function \( \sigma_0(n) \).

15. Carmichael's Totient Function

  • Carmichael Function

15.1. Definition

  • The smallest positive integer \(m\) such that \[ a^m \equiv 1\pmod{n} \] for every integer \(a\) that is coprime to \(n\).

15.2. Recurrence

  • \[ \lambda(n) = \begin{cases} \varphi(n)&\text{if $n$ is 1, 2, 4 or an odd prime power,}\\ \frac{1}{2}\varphi(n)&\text{if $n=2^r, r\ge 3$,}\\ \operatorname{lcm}\left(\lambda(n_1), \lambda(n_2),\dots,\lambda(n_k)\right)&\text{if $n=n_1n_2\dots n_k$ where $n_1,n_2,\dots,n_k$ are powers of distinct primes.} \end{cases} \]
  • \(\varphi(n)\) is the Euler's totient function.

16. Arithmetic Derivative

  • Lagarias Arithmetic Derivative, Number Derivative

16.1. Definition

  • \(D\colon \mathbb{N}\to \mathbb{N}\)
  • \(D(p) = 1, p\text{ prime}\)
  • \(D(mn) = D(m)n+ mD(n)\)
    • Leibniz Rule

16.2. Properties

  • \(D(0) = D(1) = 0\)
  • \(D(p^n) = np^{n-1}, p\text{ prime}\)
  • \(D\) is not additive, unlike the differentiation.

16.3. Extension

16.3.1. Integers

  • \(D(-n) = -D(n)\)
  • This uniquely extends the domain.

16.3.2. Rational Numbers

  • \[ D\left(\frac{m}{n}\right) = \frac{D(m)n - mD(n)}{n^2} \]
  • This is well-defined in the sense that: \[ D\left(\frac{am}{an}\right) = D\left(\frac{m}{n}\right). \]

16.4. Partial Arithmetic Derivative

  • \[ \frac{\partial x}{\partial p} = n_p\frac{x}{p}. \]
  • \[ D = \sum_{p\ \text{prime}}\frac{\partial}{\partial p}. \]
  • \[ D(x) = x\sum_{p\ \text{prime}}\frac{n_p}{p}. \]
  • where \(n_p\) can be interpreted as the p-adic valuation \(\nu_p(x)\).

17. Integer Partition

17.1. Definition

  • Way of writing \(n\) as a sum of positive integers, without distinguishing different orders.

17.2. Partition Function

  • \(p(n)\)
  • Partition function \(p(n)\) is the number of partitions of a non-negative integer \(n\).

17.3. Properties

  • \[ \sum_{n=0}^\infty p(n)q^n = \prod_{j=1}^\infty \sum_{i=0}^\infty q^{ji} = \prod_{j=1}^\infty \frac{1}{1-q^j} \]
  • Ramanujan noticed:
    • \(5\mid p(5k + 4)\), \(7\mid p(7k+5)\), \(11\mid p(11k+6)\)
  • \[ p(n) \sim \frac{1}{4n\sqrt{3}}\exp\left(\pi\sqrt{\frac{2n}{3}}\right) \]

17.4. Young Diagram

  • Ferrers Diagram

Ferrer_partitioning_diagrams.svg

Figure 1: partition

17.5. Composition

  • The order is also taken into account, unlike partitions.
  • Positive integer has \(2^{n-1}\) distinct compositions.

18. Qudratic Reciprocity

  • Law of Quadratic Reciprocity
  • The half of the nonzero elements of the finite group \( \mathbb{F}_p \) with an odd prime \( p \) is square number, and the other half is nonsquare.

18.1. Legendre Symbol

  • \[ \left( \frac{a}{p} \right) := \begin{cases} 1 & \text{if $n^2 \equiv a \mod{p}$ for some integer $n$} \\ 0 & \text{if $a \equiv 0 \mod{p}$} \\ -1 & \text{otherwise} \end{cases} \]

18.1.1. Properties

  • \[ \left( \frac{ab}{p}\right) = \left( \frac{a}{p} \right) \left( \frac{b}{p} \right) \]

18.2. Statement

For two distinct odd prime numbers \( p \) and \( q \), \[ \left( \frac{p}{q} \right)\left( \frac{q}{p} \right) = (-1)^{\frac{p-1}{2}\frac{q-1}{2}}. \]

18.3. Proof

Set up cards in the \( p\times q \) rectangular grid.

The parities of permutations upon these cards: \[ \operatorname{sgn}(R\mathpunct{\uparrow} D\mathpunct{\downarrow}) = \operatorname{sgn}(R\mathpunct{\uparrow} C\mathpunct{\downarrow}) \cdot \operatorname{sgn}(C\mathpunct{\uparrow} D\mathpunct{\downarrow}) \] corresponds to each term in the law: \[ \left( \frac{q}{p} \right) = (-1)^{\frac{p-1}{2}\frac{q-1}{2}} \cdot \left( \frac{p}{q} \right). \]

The permutation \( C\mathpunct{\uparrow}D\mathpunct{\downarrow} \) has the same parity as the permutation of integers from \( 0 \) to \( q\) generated by multiplying each elements by \( p \) module \( q \).

Due to the group isomorphism \( \mathbb{Z}_q^{\times} \cong \mathbb{Z}_{q-1}^+ \) and the conservation of parity under conjugation, this permutation in turn has the same parity as the permutation of cycling by \( k \) places, where \( k \) satisfies \( r^k = p \) for an arbitrary primitive \( r \).

The parity of cyclic permutation is 1 if \( k \) is an even, and -1 if it is odd. The \( k \) is even if and only if \( p \) is a square number, therefore this value is equal to the Legendre symbol.

19. Möbius Function

19.1. Definition

  • \[ \mu(n) = \begin{cases} 1&\text{if $n$ is square free, and has even number of prime factors},\\ -1&\text{if $n$ is square free, and has an odd number of prime factors},\\ 0&\text{if $n$ is divisible by a square}.\\ \end{cases} \]

19.2. Properties

  • \[ \sum_{n=1}^\infty \frac{\mu(n)}{n^s} = \frac{1}{\zeta(s)} \] where \(\zeta(s)\) is the Riemann zeta function.
  • The inverse of the constant 1 function under Dirichlet convolution:
    • \[ 1*\mu = \epsilon \]
    • The defining property.
    • The Dirichlet convolution with Möbius function is the inverse Möbius transform.
  • It follows that \(\mu(1) = 1\), and \[ \forall n\ge 2, \sum_{d\mid n}\mu(d) = 0. \] For examples,
    • \( \mu(1) = 1 \)
    • \( \mu(1) + \mu(2) = 0 \implies \mu(2) = -1\)
    • \( \mu(1) + \mu(2) + \mu(4) = 0 \implies \mu(4) = 0 \)
    • \( \mu(1) + \mu(2) + \mu(3) + \mu(6) = 0 \implies \mu(6) = 1 \)
    • \( \mu(1) + \mu(2) + \mu(3) + \mu(5) + \mu(6) + \mu(10) + \mu(15) + \mu(30) = 0 \implies \mu(30) = -1 \)

19.3. Möbius Inversion Formula

  • For an arithmetic function \(f, g\),
  • \[ \forall n \ge 1, g(n) = \sum_{d|n}f(d) \implies \forall n\ge 1,f(n) = \sum_{d|n}\mu(d)g\left(\frac{n}{d}\right) \]
    • In other words \(g = 1*f \implies f = \mu*g\).

20. Dirichlet Convolution

  • The coefficient of the product is then the Dirichlet convolution.

20.1. Defintion

  • For \(f,g\colon \mathbb{N}\to \mathbb{C}\),
  • \[ (f*g)(n) := \sum_{d|n} f(d)g\left(\frac{n}{d}\right) \]

20.2. Interpretation

An arithmetic function can be thought of as the coefficient of a series: \[ \sum_{n=1}^{\infty} f(n) n^x. \]

The Dirichlet convolution corresponds to finding the coefficients of the product of two such series: \[ \sum_{n=1}^{\infty}(f\ast g)(n) n^x = \left( \sum_{n=1}^{\infty} f(n) n^x \right) \left( \sum_{n=1}^{\infty}g(n) n^x \right). \]

20.3. Properties

  • \(1*1 = \sigma_0\), \(1*\mathrm{id} = \sigma_1\)
  • Identity element is \(\epsilon\), with \(\epsilon(1) = 1\) and \(\forall n\neq 1, \epsilon(n) = 0\)
  • Associative
  • Distributive over Addition
  • Commutative
  • Sequences that starts with 1, forms a group under the Dirichlet convolution.

20.4. Möbius Transform

  • The Dirichlet convolution with the constant function: \(1*f\).

21. Faulhaber's Formula

21.1. Statement

  • \[ \sum_{k=1}^n k^p = \frac{1}{p+1}\sum_{r=0}^p \binom{p+1}{r} B_r^+ n^{p+1-r} \] where \(B_r^+\) are the Bernoulli numbers.
  • Using the umbral calculus,
    • \[ \sum_{k=1}^n k^p = \frac{1}{p+1}((n+B)^{p+1} - B^{p+1}) \]

21.2. Derivation

21.2.1. Through Umbral Calculus3

  • Notice that by the property of the Bernoulli numbers \(B_n^+\):
    • \[ (k+B)^p - (k+(B-1))^p = \sum_{r=0}^p\binom{p}{r} k^r(B^{p-r} - (B-1)^{p-r}) = pk^{p-1} \]
    • \[ k^{p-1} = \frac{1}{p}(k+B)^p - (k+(B-1))^p. \]
  • Therefore, by the telescoping series,
    • \[ \sum_{k=1}^n k^{p-1} = \sum_{k=1}^n \frac{1}{p}(k+B)^p - (k+(B-1))^p = \frac{1}{p}((n+B)^p - B^p) \]

21.2.2. Using Differential Operator4

Notice that \[ (e^D - 1)f(x) = f(x+1) - f(x) \implies Df(x) = \frac{D}{e^D-1}(f(x+1) - f(x)) \]

For a function \[ f(x) = \frac{x^{p+1}}{p+1}, \] using the generating function the formula simplifies to

\begin{align*} x^p &= \sum_{k=0}^\infty \frac{B_k^-}{k!}D^k \frac{1}{p+1}((x+1)^{p+1} - x^{p+1}) \\ &= \sum_{k=0}^\infty \frac{B_k^-}{k!}\frac{(p+1)^{\underline{k}}}{p+1}((x+1)^{p+1-k} - x^{p+1-k})\\ &= \sum_{k=0}^\infty \frac{B_k^-}{k}\binom{p}{k-1}((x+1)^{p+1-k} - x^{p+1-k}) \end{align*}

Therefore, by the telescoping action,

\begin{align*} \sum_{k=1}^n k^p &= \sum_{r=0}^\infty \frac{B_r^-}{r}\binom{p}{r-1}\sum_{k=1}^n((k+1)^{p+1-r} - k^{p+1-r})\\ &= \sum_{r=0}^\infty \frac{B_r^-}{r}\binom{p}{r-1}((n+1)^{p+1-r} - 1). \end{align*}

21.3. Bernoulli Numbers

21.3.1. Definition

  • Note that these are \(B_n^-\), in which \(B_1 = -\frac{1}{2}\).
21.3.1.1. Via Recursive Relation
  • \[ \sum_{k=0}^n\binom{n+1}{k}B_k = \delta_{n,0}. \]
21.3.1.2. Via Generating Function
  • \[ \frac{t}{e^t - 1} = \sum_{k=0}^\infty B_k^- \frac{t^k}{k!}. \]

21.3.2. Properties

  • Using the umbral calculus, the \(B_n^+\) can be obtained by: for \(k > 1\)
    • \[ (B-1)^k = B^k. \]

21.3.3. Bernoulli Polynomials

  • The exponential generating function is:
    • \[ \frac{te^{xt}}{e^t - 1} =: \sum_{n=0}^\infty B_n(x)\frac{t^n}{n!} \]

22. Euler Numbers

22.1. Defintion

22.2. Properties

  • Every odd Euler numbers are zero.

22.3. Euler Polynomials

  • The exponential generating function for the Euler polynomials is:
    • \[ \frac{2e^{xt}}{e^t - 1} = \sum_{n=0}^\infty E_n(x)\frac{t^n}{n!} \]
  • It forms a close parallel to the Bernoulli polynomials

22.4. Examples

  • \(E_0 = 1\)
  • \(E_2 = -1\)
  • \(E_4 = 5\)
  • \(E_6 = -61\)

23. Diophantine Equation

Equation with integer solutions

23.1. Pell's Equation

  • Pell Equation, Pell-Fermat Equation

23.1.1. Equation

  • \[ x^2 - ny^2 = 1 \] where \(n\) is a positive nonsquare integer.
    • \(n\) needs to be nonsquare since the difference between two square integer is never 1.

23.1.2. Properties

  • The ratio \(x/y\) approximate the \(\sqrt{n}\).

23.1.3. Solutions

23.1.3.1. Fundamental Solution
  • It is the numerator and the denominator of the partial continued fraction for \(\sqrt{n}\).
  • Specifically, until right before the period if period is an even number, or right before twice the period if the period is an odd number.
23.1.3.2. Additional Solutions
  • Given a fundamental solution \((x_1, y_1)\), every solutions can be calculated from: \[ x_k + y_k\sqrt{n} = (x_1+y_1\sqrt{n})^k. \]
    • Equivalently, by the recurrence relations:

      \begin{align*} x_{k+1} &= x_1x_k + ny_1y_k,\\ y_{k+1} &= x_1y_k + y_1x_k. \end{align*}

23.1.4. Archimedes's Cattle Problem

If thou art diligent and wise, O stranger, compute the number of , who once upon a time grazed on the fields of the Thrinacian isle of Sicily, divided into four herds of different colours, one milk white, another a glossy black, a third yellow and the last dappled. In each herd were bulls, mighty in number according to these proportions: Understand, stranger, that the white bulls were equal to a half and a third of the black together with the whole of the yellow, while the black were equal to the fourth part of the dappled and a fifth, together with, once more, the whole of the yellow. Observe further that the remaining bulls, the dappled, were equal to a sixth part of the white and a seventh, together with all of the yellow. These were the proportions of the cows: The white were precisely equal to the third part and a fourth of the whole herd of the black; while the black were equal to the fourth part once more of the dappled and with it a fifth part, when all, including the bulls, went to pasture together. Now the dappled in four parts were equal in number to a fifth part and a sixth of the yellow herd. Finally the yellow were in number equal to a sixth part and a seventh of the white herd. If thou canst accurately tell, O stranger, the number of cattle of the Sun, giving separately the number of well-fed bulls and again the number of females according to each colour, thou wouldst not be called unskilled or ignorant of numbers, but not yet shalt thou be numbered among the wise. But come, understand also all these conditions regarding the cattle of the Sun. When the white bulls mingled their number with the black, they stood firm, equal in depth and breadth, and the plains of Thrinacia, stretching far in all ways, were filled with their multitude. Again, when the yellow and the dappled bulls were gathered into one herd they stood in such a manner that their number, beginning from one, grew slowly greater till it completed a triangular figure, there being no bulls of other colours in their midst nor none of them lacking. If thou art able, O stranger, to find out all these things and gather them together in your mind, giving all the relations, thou shalt depart crowned with glory and knowing that thou hast been adjudged perfect in this species of wisdom.

23.2. Third Order

24. Continued Fraction

24.1. Classification

24.1.1. Finite Continued Fraction

  • Terminated Continued Fraction
  • \[ a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{\ddots +\dfrac{1}{a_n}}}} \]
  • \(a_n\) can be obtained through the Euclidean algorithm

24.1.2. Infinite Continued Fraction

24.1.2.1. Regular Continued Fraction
  • The numerator is generally assumed to be 1, in such case it may be called simple or regular continued fraction, or said to be in canonical form.
  • \[ a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{a_3 +{ \atop \ddots}}}} \]
24.1.2.2. Generalized Continued Fraction
  • \[ b_0 + \dfrac{a_1}{b_1 + \dfrac{a_2}{b_2 + \dfrac{a_3}{b_3 +{ \atop \ddots}}}} \]

24.2. Extension

24.2.1. Using Mediant

  • Start with \[ L_0 = \frac{0}{1},\quad R_0 = \frac{1}{1} \]
  • The first iteration \[ R_1 = R_0\oplus (a_1-1)L_0 \equiv \frac{1}{a_1},\quad L_1 = L_0 \]
    • where \(\oplus\) is for mediant and juxtaposition is for multiplication on both the numerator and the denominator.
  • The second iteration \[ L_2 = L_1\oplus a_2 R_1,\quad R_2 = R_1 \]
    • \[ L_2 = L_0\oplus a_2(R_0\oplus (a_1-1)L_0) = (a_1a_2-a_2+1)L_0\oplus a_2R_0 \]
    • \[ L_2 = \frac{a_2}{a_1a_2 + 1} \equiv \dfrac{1}{a_1 + \dfrac{1}{a_2}} \]
  • The third iteration \[ R_3 = R_2\oplus a_3L_2,\quad L_3 = L_2 \]
    • \[ R_3 = (R_0\oplus (a_1-1)L_0)\oplus a_3((a_1a_2-a_2+1)L_0\oplus a_2R_0)\\ = (a_1a_2a_3 - a_2a_3 + a_3 + a_1 - 1)L_0\oplus (a_2a_3 + 1)R_0 \]
    • \[ R_3 = \frac{a_2a_3+1}{a_1a_2a_3 + a_3 + a_1} \equiv \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{a_3}}} \]
  • More generally,

    \begin{cases} L_{k+1} = L_k\oplus a_{k+1}R_k,\ R_{k+1} = R_k & \text{$k$ odd}\\ R_{k+1} = R_k\oplus a_{k+1}L_k,\ L_{k+1} = L_k & \text{$k$ even, $k > 0$} \end{cases}
    • Note that \(L_n \oplus R_n\), which is the last step in the generation via Farey sequence, is calculated to be: \[ L_n \oplus R_n = L_{n-1}\oplus (a_{n}+1)R_{n-1}\text{ or } (a_n+1)L_{n-1}\oplus R_{n-1} \\[1em] \equiv \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{\ddots +\dfrac{1}{a_n+\dfrac{1}{1}}}}} \]

24.3. Notation

24.3.1. Kettenbruch

  • German word for continued fraction
  • \[ b_0 + \mathop{\Large\rm K}\limits_{i=1}^n\frac{a_i}{b_i} \]

25. Farey Sequence

  • Farey Subdivision

25.1. Definition

  • Farey sequence of order \(n\) is completely reduced fractions between, and including, 0 and 1, with the largest denominator being the number \(n\).

25.2. Farey Neighbors

  • Every fractions up to reduction can be generated by Farey sequence. The construction is \[ \frac{a}{b}\oplus \frac{c}{d}=\frac{a+c}{b+d} \] where \(\oplus\) is for the mediant.

25.3. Properties

  • It is a projection of upper half of the standard lattice (lattice with base \((1,0),(0,1)\)) onto the line \(y=1\).
  • This extends the Farey sequence to the entire real line, which makes Farey sequence the natural structure of \(\mathbb{R}\).

25.4. Generation of Continued Fraction

  • It can generate a continued fraction representation of a real number, by counting how many consecutive left or right bubble has been pierced by the line extending from the above.
  • First take the integer part of the real number for the integer part of the continued fraction. \[ [\lfloor x \rfloor;\dots,1] \]
  • Count the first bubble as left bubble, and continue counting. \(L^{a_{1}}R^{a_{2}}L^{a_{3}}\dots\)
  • These become the fractional part. \[ [\lfloor x \rfloor;a_{1},a_{2},\dots,1]=\lfloor x \rfloor+\dfrac{1}{a_{1}+\dfrac{1}{a_{2}+\dfrac{\ddots}{1}}} \]

    Taking the continued fraction just before some large \(a_{i}\), \([n;a_{1},a_{2},\dots,a_{i-1}]\), It becomes a particularly good Diophantine approximation of the real number with relatively small denominator, which is related to Dirichlet's approximation theorem.

26. Mediant

26.1. Definition

  • Mediant of two rational number is defined as \[ \frac{a}{b}\oplus \frac{c}{d} \equiv \frac{a+c}{b+d} \]
  • Mediant can be thought of as vector addition \[ \begin{bmatrix} a \\ b \end{bmatrix} +\begin{bmatrix} c \\ d \end{bmatrix} = \begin{bmatrix} a+c \\ b+d \end{bmatrix} \] This can be translated to rational numbers by
    • taking the slope,
    • or projecting to the line \(y=1\) with respect to the origin, which is equivalent to taking the reciprocal of the slope.

26.2. Properties

  • \[ \frac{a}{b} = \frac{c}{d} = k \implies \frac{a+c}{b+d} = k. \]

27. Diophantine Approximation

27.1. Irrationality Measure

  • Liouville-Roth Irrationality Measure, Irrationality Exponent, Approximation Exponent, Liouville-Roth Constant

27.1.1. Definition

  • Irrationality measure \(\mu\) of a real number \(x\) is the largest value that satisfies \[ 0<\left| x-\frac{p}{q} \right| < \frac{1}{q^{\mu}} \] for infinitely many reduced rational number \(p / q\) with \(q>0\).

27.2. Dirichlet's Approximation Theorem

27.2.1. Statement

  • \[ \forall \alpha, N\in \mathbb{R}, N \ge 1; \exists p, q \in \mathbb{Z}, 1\le q \le N : |q\alpha-p|\le \frac{1}{\lfloor N \rfloor +1} \lt \frac{1}{N}. \]
  • This implies \(\forall \alpha \in \mathbb{R}\), there exist infinitely many pairs of integer \((p,q)\) : \[ 0 < \left| \alpha-\frac{p}{q} \right| < \frac{1}{q^{2}}. \]
  • This shows that every irrational number has irrationality measure of at least 2.

27.3. Best Approximation

27.3.1. Definition

  • For a real number \(\alpha\), best Diophantine approximation of \(\alpha\) is defined as \[ \frac{p}{q} : \forall p',q' \in \mathbb{Z}, 0

27.4. Roth's Theorem

  • Thue-Siegel-Roth Theorem
    • Algebraic numbers cannot have many Diophantine approximations that are "very good".

27.4.1. Statement

  • Every irrational algebraic number \(\alpha\) has approximation exponent of 2.
    • That is for every \(\varepsilon > 0\), the inequality \[ \left| \alpha - \frac{p}{q}\right| < \frac{1}{q^{2+\varepsilon}} \] can have only finitely many solutions in coprime integers \(p\) and \(q\).

27.5. Liouville Number

  • \(x\in \mathbb{R}\), for every positive integer \(n\), there exists a pair of integers \((p, q)\) with \(q>1\) such that \[ 0< \left| x - \frac{p}{q}\right| < \frac{1}{q^n}. \]

27.5.1. Properties

  • Liouville numbers are transcendental numbers.

28. p-adic Number

28.1. Definition

  • A number that's a possibly infinite sum of possibly negative powers of prime \(p\) with coefficients less than \(p\). Only finite number of negative powers of \(p\) are allowed.
  • If no negative powers are present than it's specifically called a p-adic integer.
  • Completely separate number system that lies outside of real or complex numbers.
  • If we establish an isomorphism between p-adic and real, we can solve problem in the p-adic realm and translate it into a real number.

28.2. Properties

  • Basic lemma: There exists an injection from rational numbers to p-adic numbers.
  • p-adic contains real numbers.
  • 2-adic has \(\pm \sqrt{-3/2}\) but not \(\sqrt{-1}\).
  • 5-adic contains complex numbers.

28.3. p-adic Valuation

28.3.1. Definition

  • \(\nu_p\colon \mathbb{Z} \to \mathbb{N}_0\cup \{\infty\}\)
  • \[ \nu_p(n) = \begin{cases} \max\{k\in \mathbb{N}_0 \colon p^k \mid n\} & \text{if $n\neq 0$},\\ \infty & \text{if $n=0$.} \end{cases} \]

28.3.2. Extension

28.3.2.1. Rational Numbers
  • \(\nu_p\colon \mathbb{Q} \to \mathbb{Z}\cup \{\infty\}\)
  • \[ \nu_p\left(\frac{r}{s}\right) = \nu_p(r) - \nu_p(s). \]

28.3.3. Properties

  • \(\nu_p(r\cdot s) = \nu_p(r) + \nu_p(s)\)
  • \(\nu_p(r + s) \ge \min\{\nu_p(r), \nu_p(s)\}\)

28.3.4. p-adic Absolute Value

28.3.4.1. Definition
  • \(|\cdot |_p\colon \mathbb{Q}\to \mathbb{R}_{\ge 0}\)
  • \(|r|_p = p^{-\nu_p(r)}.\)
28.3.4.2. Examples
  • \(|0|_p = p^{-\infty} = 0\)
  • \(|1|_p = 1\)
28.3.4.3. Properties
  • Non-negativity: \(|r|_p \ge 0\)
  • Positive-definiteness: \(|r|_p = 0 \iff r = 0\)
  • Multiplicativity: \(|rs|_p = |r|_p|s|_p\)
  • Non-Archimedean: \(|r+s|_p \le \max\{|r|_p, |s|_p\}\)

29. Combinatorial Quantities

29.1. Binomial Coefficient

  • Combination

29.1.1. Definition

  • \[ \binom{\alpha}{k} := \frac{\alpha^{\underline{k}}}{k!} \]

29.1.2. Properties

29.1.2.1. Derivative
  • Using the logarithmic derivative, \[ \frac{d}{dx}\binom{x}{k} = \binom{x}{k}\sum_{r=0}^{k-1}\frac{1}{k-r}. \]

29.1.3. Binomial Theorem

29.1.3.1. Corollary
  • \[ \frac{1}{\displaystyle\sum_{k=0}^n\binom{n}{k}x^k} = \sum_{k=0}^\infty \binom{-n}{k}x^k. \]

29.1.4. Pascal's Triangle

29.1.4.1. Definition
  • It is numbers arranged in a triangular shape such that the sum of the two adjacent number is the number below the two.
29.1.4.2. Viks' Pyramid

Extension of the Pascal's triangle

29.2. Permutation

29.3. Combination with Repetition

  • Multicombination, Multisubset, 중복조합
  • \[ \left(\!\!\binom{n}{k}\!\!\right) = \binom{n+k-1}{k} \]
  • Stars and bars

29.4. Multinomial Coefficient

  • Permutation by Bins
    • 같은 것이 있는 순열
    • \[ \begin{pmatrix} n\\ k_1, k_2,\dots , k_m\end{pmatrix} := \frac{n!}{k_1!k_2!\dots k_m!} \]
      • when \(\sum_i k_i \neq n\), it is defined to be 0.

29.5. Circular Permutation

  • 원순열

29.6. Circular Permutation with Repetition

  • \(a^{p}-a\) for prime number length.

29.7. Circular Permutation by Bins

  • \[ \frac{1}{n}\sum_{l|\mathrm{gcd}(p, q, r)}\varphi(l)\frac{(n/l)!}{(p/l)!(q/l)!(r/l)!} \]
  • It is derived from Burnside's lemma, by noticing that it is the quotient set of all possible permutation by the cyclic group \( C_n \).
    • The summands counts the number of fixed elements by the rotation by the multiple of \(l\) units, excluding the overlapping rotations, which is naturally accounted in the \(\varphi(l)\) which counts the number of generators of \(C_l\).
    • The factorial part only counts the permutation within \(1/l\) of the entire sequence.
    • \(l|\gcd(p,q,r) \implies l|n\)

30. Necklace Polynomial

30.1. Definition

  • \(M(\alpha, n)\) is the number of distinct aperiodic necklaces of \(n\) beads chosen out of \(\alpha\) available colors.
  • \[ \alpha^n = \sum_{d|n} d\cdot M(\alpha, d) \]

30.2. General Necklace Polynomial

  • General Necklace-Counting Function
  • It includes the periodic ones as well.
  • \[ N(\alpha, n) = \sum_{d|n}M(\alpha,d) = \frac{1}{n}\sum_{d|n}\varphi\left(\frac{n}{d}\right)\alpha^d \]
  • The second formulation is obtained by the Burnside's lemma.

31. Pólya Enumeration Theorem

  • Redfield-Pólya Theorem, Pólya Counting
  • Generalization of the Burnside's lemma for the coloring case.

31.1. Statement

  • Let \(X\) be a finite set, \(G\) be the group of permutations of \(X\), and \(Y\) be a possibly infinite weighted set with the numbers \(f_{w_i}\) of scalar- or vector-valued weight \(w_i\in \mathbb{N}_0^{k\le \infty}\) elements are given by the generating function: \[ f(t_1, t_2,\dots) = f_{(0,0,\dots)} + f_{(1,0,\dots)}t_1 + f_{(0,1,\dots)}t_2 + \cdots + f_{(1,1,\dots)}t_1t_2 + \cdots + f_{(2,0,\dots)}t_1^2 + \dots. \]
    • The exponent is the weight, and the subscript is the position of the weight.
  • Let \(Z_G\) be the multivariate generating function cycle index: \[ Z_G(t_1, t_2, \dots, t_n) = \frac{1}{|G|}\sum_{g\in G}t_1^{c_1(g)}t_2^{c_2(g)}\cdots t_n^{c_n(g)} \]
    • where \(n = |X|\) and \(c_k(g)\) is the number of \(k\)-cycles of the group element \(g\) as a permutation of \(X\).
  • The generating function \(F(t_1, t_2, \dots)\) of the number \(F_{w_i}\) of arrangements \(\varphi\in Y^X\) with weight \(w_i = \sum_{x\in X}w(\varphi(x))\) is given by:
    • \[ F(t_1, t_2, \dots) = Z_G(f(t_1, t_2, \dots), f(t_1^2, t_2^2, \dots), f(t_1^3, t_2^3, \dots), \dots, f(t_1^n, t_2^n, \dots)). \]

31.2. Cycle Index

  • For a group \(G\) as the permutations (often by a natural action), the cycle index is
  • \[ Z(G) = \frac{1}{|G|}\sum_{g\in G}\prod_{k=1}^n a_k^{j_k(g)} \]
    • where \( j_k(g) \) is the number of cycles of \( g \) of length \( k \).
  • It is well defined, since every permutation \( g \) in \(G\) has a unique decomposition into disjoint cycles: \[ \prod_{c\ \text{cycle}\in g}a_{|c|} = \prod_{k=1}^na_k^{j_k(g)} \]
    • \( |c| \) is the length of the cycle \(c\).
  • The group \(G\) consists of coefficient number of elements containing the exponent number of cycles of length given by the subscript.

31.3. Special Case

  • For the special case, that there are \(m\) elements (colors) in \(Y\) with wight 0, \(f(t) = m\).
  • \[ F(0) = Z_G(m,m,\dots,m) \]
  • which simplifies to \[ |Y^X/G| = \frac{1}{|G|}\sum_{g\in G}m^{c(g)}. \]

32. Parity of Permutation

  • Sign of Permutation, Signature of Permutation
  • \(\mathrm{sgn}\)

32.1. Definition

  • Parity of the number of inversions: \[ \operatorname{sgn}(\sigma) = (-1)^{N(\sigma)} \]
  • The number of transpositions equivalent. Although there's many possible decompositions, the parity remains the same, which means the parity is well-defined.

32.2. Inversion

  • A pair of elements that are out of order with respect to the initial position.

33. Non-Consecutive Ordering

\[ \sum_{k=0}^{n-1}(-1)^k(n-k)!\sum_{r=1}^k2^r\binom{n-k}{r}\binom{k-1}{r-1}. \]

  • \( n \) numbers, \( k \) forbidden pairs, \( r \) parts

A Lifelong Mathematical Obsession - YouTube

34. DIE Method

  • Describe, Involution, Exception
  • It is the method for finding the alternating sum.

34.1. Method

  • Describe: Describe the term
  • Involution: Find the parity involution
  • Exception: The exception to the parity involution will be left behind as the result of the sum.

35. Reference

Footnotes:

Created: 2025-05-06 Tue 23:34