1.6 Find a solution of ax ≡ b (mod n) · 일차합동식의 풀이

THM 1.37 일차합동식의 유일한 해 A Unique Solution of ax ≡ b (mod n)
한국어

$n \in \mathbb{N}$, $n \ge 2$이고 $a, b \in \mathbb{Z}$라 하자. $\gcd(a, n) = 1$이면 $ax \equiv b \ (\bmod\ n)$은 유일한 해를 가진다.

$\gcd(a, n) = 1$이므로 $a^{-1} \ (\bmod\ n)$이 존재한다.

$$\begin{aligned} & ax \equiv b \ (\bmod\ n) \\ \Leftrightarrow & a^{-1}(ax) \equiv a^{-1}b \ (\bmod\ n) \\ \Leftrightarrow & x \equiv a^{-1}b \ (\bmod\ n) \end{aligned}$$

따라서 $ax \equiv b \ (\bmod\ n)$은 유일한 해 $x \equiv a^{-1}b \ (\bmod\ n)$을 가진다.

English

Let $n \in \mathbb{N}$, $n \ge 2$, and $a, b \in \mathbb{Z}$. If $\gcd(a, n) = 1$, then $ax \equiv b \ (\bmod\ n)$ has a unique solution.

Since $\gcd(a, n) = 1$, there exists $a^{-1} \ (\bmod\ n)$.

$$\begin{aligned} & ax \equiv b \ (\bmod\ n) \\ \Leftrightarrow & a^{-1}(ax) \equiv a^{-1}b \ (\bmod\ n) \\ \Leftrightarrow & x \equiv a^{-1}b \ (\bmod\ n) \end{aligned}$$

Therefore $ax \equiv b \ (\bmod\ n)$ has a unique solution $x \equiv a^{-1}b \ (\bmod\ n)$.

EXAM 1.38 3x ≡ 2 (mod 8)의 해 Solving 3x ≡ 2 (mod 8)
한국어

$3x \equiv 2 \ (\bmod\ 8)$의 해를 구하자. $\gcd(3, 8) = 1$이므로 정리 1.37에 의해 $3x \equiv 2 \ (\bmod\ 8)$은 유일한 해를 가진다. 그러면 $x \equiv 3^{-1}2 \equiv 3 \times 2 \equiv 6 \ (\bmod\ 8)$이다.

English

Find the solution of $3x \equiv 2 \ (\bmod\ 8)$. Since $\gcd(3, 8) = 1$, by theorem 1.37, $3x \equiv 2 \ (\bmod\ 8)$ has a unique solution. And then $x \equiv 3^{-1}2 \equiv 3 \times 2 \equiv 6 \ (\bmod\ 8)$.

REM 2 해가 유일하지 않은 경우와 음의 지수 Non-unique Solutions and Negative Exponents
한국어

1. 식 $3x \equiv 0 \ (\bmod\ 6)$은 해 $x \equiv 0, 2, 4 \ (\bmod\ 6)$을 가지며 유일한 해가 아니다.

2. $a^{-1}$을 법 $n$에 대한 $a$의 역원이라 하자. $a^{-n} := a^{-1} \cdots a^{-1}$($a^{-1}$을 $n$번 곱한 것)로 정의한다. $m \in \mathbb{N}$에 대하여 $a^{-1}a^m \equiv a^{m-1} \ (\bmod\ n)$임에 주의하자. 따라서 모든 $m, m' \in \mathbb{Z}$에 대하여 $a^m a^{m'} \equiv a^{m+m'} \ (\bmod\ n)$이다.

English

1. The formula $3x \equiv 0 \ (\bmod\ 6)$ has solutions $x \equiv 0, 2, 4 \ (\bmod\ 6)$ not a unique solution.

2. Let $a^{-1}$ be the inverse of $a$ modulo $n$. Define $a^{-n} := a^{-1} \cdots a^{-1}$, $n$ times multiple of $a^{-1}$. For $m \in \mathbb{N}$, note that $a^{-1}a^m \equiv a^{m-1} \ (\bmod\ n)$. Therefore $a^m a^{m'} \equiv a^{m+m'} \ (\bmod\ n)$ for all $m, m' \in \mathbb{Z}$.

1.7 Chinese remainder theorem · 중국인의 나머지 정리

NOTE
한국어

$x \equiv 4 \ (\bmod\ 7)$, $x \equiv 9 \ (\bmod\ 11)$, $x \equiv 3 \ (\bmod\ 13)$이라 하자. $T_1 \equiv 4 \ (\bmod\ 7), T_2 \equiv 0 \ (\bmod\ 7), T_3 \equiv 0 \ (\bmod\ 7), T_1 \equiv 0 \ (\bmod\ 11), T_2 \equiv 9 \ (\bmod\ 11), T_3 \equiv 0 \ (\bmod\ 11), T_1 \equiv 0 \ (\bmod\ 13), T_2 \equiv 0 \ (\bmod\ 13)$, $T_3 \equiv 3 \ (\bmod\ 13)$을 만족하는 정수를 구하자. 그러면 $T_1 + T_2 + T_3$은 연립합동식의 해이다. 어떤 정수 $a_1, a_2, a_3$에 대하여 $T_1 = a_1 \cdot 11 \cdot 13$, $T_2 = a_2 \cdot 7 \cdot 13$, $T_3 = a_3 \cdot 7 \cdot 11$이라 하자. 그러면 $T_2 \equiv 0 \ (\bmod\ 7), T_3 \equiv 0 \ (\bmod\ 7), T_1 \equiv 0 \ (\bmod\ 11), T_3 \equiv 0 \ (\bmod\ 11), T_1 \equiv 0 \ (\bmod\ 13)$, $T_2 \equiv 0 \ (\bmod\ 13)$이다. 다음을 만족하는 $a_1, a_2, a_3 \in \mathbb{Z}$를 구하자.

$$a_1 \cdot 11 \cdot 13 \equiv 4 \ (\bmod\ 7), a_2 \cdot 7 \cdot 13 \equiv 9 \ (\bmod\ 11), a_3 \cdot 7 \cdot 11 \equiv 3 \ (\bmod\ 13).$$

그러면 $a_1 \equiv (11 \cdot 13)^{-1} \cdot 4 \ (\bmod\ 7)$, $a_2 \equiv (7 \cdot 13)^{-1} \cdot 9 \ (\bmod\ 11)$, $a_3 \equiv (7 \cdot 11)^{-1}3 \ (\bmod\ 13)$이다. 따라서 $a_1 \equiv 6 \ (\bmod\ 7), a_2 \equiv 3 \ (\bmod\ 11), a_3 \equiv 10 \ (\bmod\ 13)$이다. 마지막으로

$$x \equiv T_1 + T_2 + T_3 \equiv 6 \cdot 11 \cdot 13 + 3 \cdot 7 \cdot 13 + 10 \cdot 7 \cdot 11 \equiv 900 \ (\bmod\ 7 \cdot 11 \cdot 13).$$
English

Let $x \equiv 4 \ (\bmod\ 7)$, $x \equiv 9 \ (\bmod\ 11)$, and $x \equiv 3 \ (\bmod\ 13)$. Find the integer such that $T_1 \equiv 4 \ (\bmod\ 7), T_2 \equiv 0 \ (\bmod\ 7), T_3 \equiv 0 \ (\bmod\ 7), T_1 \equiv 0 \ (\bmod\ 11), T_2 \equiv 9 \ (\bmod\ 11), T_3 \equiv 0 \ (\bmod\ 11), T_1 \equiv 0 \ (\bmod\ 13), T_2 \equiv 0 \ (\bmod\ 13)$ and $T_3 \equiv 3 \ (\bmod\ 13)$. Then $T_1 + T_2 + T_3$ is a solution of the system. Let $T_1 = a_1 \cdot 11 \cdot 13$, $T_2 = a_2 \cdot 7 \cdot 13$ and $T_3 = a_3 \cdot 7 \cdot 11$ for some integer $a_1, a_2, a_3$. Then $T_2 \equiv 0 \ (\bmod\ 7), T_3 \equiv 0 \ (\bmod\ 7), T_1 \equiv 0 \ (\bmod\ 11), T_3 \equiv 0 \ (\bmod\ 11), T_1 \equiv 0 \ (\bmod\ 13)$ and $T_2 \equiv 0 \ (\bmod\ 13)$. Find $a_1, a_2, a_3 \in \mathbb{Z}$ such that

$$a_1 \cdot 11 \cdot 13 \equiv 4 \ (\bmod\ 7), a_2 \cdot 7 \cdot 13 \equiv 9 \ (\bmod\ 11), a_3 \cdot 7 \cdot 11 \equiv 3 \ (\bmod\ 13).$$

Then $a_1 \equiv (11 \cdot 13)^{-1} \cdot 4 \ (\bmod\ 7)$, $a_2 \equiv (7 \cdot 13)^{-1} \cdot 9 \ (\bmod\ 11)$, $a_3 \equiv (7 \cdot 11)^{-1}3 \ (\bmod\ 13)$. So $a_1 \equiv 6 \ (\bmod\ 7), a_2 \equiv 3 \ (\bmod\ 11), a_3 \equiv 10 \ (\bmod\ 13)$. Finally

$$x \equiv T_1 + T_2 + T_3 \equiv 6 \cdot 11 \cdot 13 + 3 \cdot 7 \cdot 13 + 10 \cdot 7 \cdot 11 \equiv 900 \ (\bmod\ 7 \cdot 11 \cdot 13).$$
THM 1.39 중국인의 나머지 정리 Chinese Remainder Theorem
한국어

$m_1, \cdots, m_n$이 쌍마다 서로소인 양의 정수라 하자. $a_i \in \mathbb{Z}$ $(1 \le i \le n)$에 대하여 연립합동식 $x \equiv a_1 \ (\bmod\ m_1), \cdots, x \equiv a_n \ (\bmod\ m_n)$은 법 $m_1 \cdots m_n$에 대하여 유일한 해를 가진다.

(유일성)

$x, y \in \mathbb{Z}$가 위 연립합동식의 해라고 하자. 그러면 모든 $i$에 대하여 $x \equiv y \equiv a_i \ (\bmod\ m_i)$이다. 그러므로 모든 $i$에 대하여 $x - y \equiv 0 \ (\bmod\ m_i)$이다. 다시 말해 모든 $i$에 대하여 $m_i|(x - y)$이다. 따라서 $\operatorname{lcm}(m_1, \cdots, m_n)|(x - y)$이다. $m_1, \cdots, m_n$이 쌍마다 서로소인 양의 정수이면 $\operatorname{lcm}(m_1, \cdots, m_n) = m_1 \cdots m_n$임에 주의하자. 그러므로 $m_1 \cdots m_n|(x - y)$이다. 따라서 $x \equiv y \ (\bmod\ m_1 \cdots m_n)$이다.

English

Let $m_1, \cdots, m_n$ be the pairwise relatively prime positive integers. For $a_i \in \mathbb{Z}, 1 \le i \le n$, the system $x \equiv a_1 \ (\bmod\ m_1), \cdots, x \equiv a_n \ (\bmod\ m_n)$ has a unique solution modulo $m_1 \cdots m_n$.

(Uniqueness)

Assume that $x, y \in \mathbb{Z}$ are solutions of the above system. Then $x \equiv y \equiv a_i \ (\bmod\ m_i)$ for all $i$. So $x - y \equiv 0 \ (\bmod\ m_i)$ for all $i$. In other words, $m_i|(x - y)$ for all $i$. Therefore $\operatorname{lcm}(m_1, \cdots, m_n)|(x - y)$. Note that if $m_1, \cdots, m_n$ are the pairwise relatively prime positive integers, then $\operatorname{lcm}(m_1, \cdots, m_n) = m_1 \cdots m_n$. So $m_1 \cdots m_n|(x - y)$. Therefore $x \equiv y \ (\bmod\ m_1 \cdots m_n)$.

ALGO 중국인의 나머지 정리 알고리즘 Chinese Remainder Theorem (Algorithm)
한국어

입력 : 쌍마다 서로소인 양의 정수 $m_1, \cdots, m_n$과 $a_1, \cdots, a_n \in \mathbb{Z}$

출력 : 연립합동식 $x \equiv a_1 \ (\bmod\ m_1), \cdots, x \equiv a_n \ (\bmod\ m_n)$의 해

  1. $M = m_1 \cdots m_n$, $M_i = M/m_i$로 정의한다.
  2. $N_i \in \mathbb{Z}$가 법 $m_i$에 대한 $M_i$의 역원이 되도록 하는 $N_i$를 구한다.
  3. 위 연립합동식의 해는 $x \equiv a_1N_1M_1 + \cdots + a_nN_nM_n \ (\bmod\ M)$이다.

역주. 원문 1단계는 "$M_i = M_i$"로 인쇄되어 있으나(항등식이 되어 뜻이 없음) 문맥상 $M_i = M/m_i$이다. 또한 원문 3단계는 "$x \equiv a_1N_1m_1 + \cdots + a_nN_nm_n$"으로 인쇄되어 있으나, $N_iM_i \equiv 1 \ (\bmod\ m_i)$이고 $j \neq i$이면 $m_i \mid M_j$이므로 해가 되는 식은 $x \equiv a_1N_1M_1 + \cdots + a_nN_nM_n$이다(소문자 $m_i$를 쓰면 성립하지 않는다). 위에서 둘 다 바로잡아 옮겼다.

English

Input : pairwise relatively prime positive integers $m_1, \cdots, m_n$ and $a_1, \cdots, a_n \in \mathbb{Z}$

Output : a solution of the system $x \equiv a_1 \ (\bmod\ m_1), \cdots, x \equiv a_n \ (\bmod\ m_n)$

  1. Define $M = m_1 \cdots m_n$ and $M_i = M_i$.
  2. Find $N_i \in Z$ such that $N_i$ is inverse of $M_i$ modulo $m_i$.
  3. A solution of the above system is $x \equiv a_1N_1m_1 + \cdots + a_nN_nm_n \ (\bmod\ M)$.
EX 1.40 13x ≡ 4 (mod 80) 풀기 Solving 13x ≡ 4 (mod 80)
한국어

$13x \equiv 4 \ (\bmod\ 80)$을 풀어라.

$\gcd(13, 80) = 1$이므로 정리 1.37에 의해 $13x \equiv 4 \ (\bmod\ 80)$은 유일한 해를 가진다. 먼저 유클리드 호제법으로 $13^{-1} \ (\bmod\ 80)$을 구하자.

$$80 = 13 \cdot 6 + 2, \qquad 13 = 2 \cdot 6 + 1, \qquad 2 = 1 \cdot 2 + 0.$$

역대입하면

$$1 = 13 - 6 \cdot 2 = 13 - 6(80 - 6 \cdot 13) = 37 \cdot 13 - 6 \cdot 80$$

이므로 $13^{-1} \equiv 37 \ (\bmod\ 80)$이다(확인: $13 \times 37 = 481 = 6 \times 80 + 1$). 따라서

$$x \equiv 37 \times 4 = 148 \equiv 68 \ (\bmod\ 80).$$

확인: $13 \times 68 = 884 = 11 \times 80 + 4$.

English

Solve $13x \equiv 4 \ (\bmod\ 80)$.

Since $\gcd(13, 80) = 1$, by Theorem 1.37, $13x \equiv 4 \ (\bmod\ 80)$ has a unique solution. First find $13^{-1} \ (\bmod\ 80)$ by the Euclidean algorithm.

$$80 = 13 \cdot 6 + 2, \qquad 13 = 2 \cdot 6 + 1, \qquad 2 = 1 \cdot 2 + 0.$$

Back-substituting,

$$1 = 13 - 6 \cdot 2 = 13 - 6(80 - 6 \cdot 13) = 37 \cdot 13 - 6 \cdot 80$$

so $13^{-1} \equiv 37 \ (\bmod\ 80)$ (check: $13 \times 37 = 481 = 6 \times 80 + 1$). Therefore

$$x \equiv 37 \times 4 = 148 \equiv 68 \ (\bmod\ 80).$$

Check: $13 \times 68 = 884 = 11 \times 80 + 4$.

EX 1.41 3x ≡ 0 (mod 18) 풀기 Solving 3x ≡ 0 (mod 18)
한국어

$3x \equiv 0 \ (\bmod\ 18)$을 풀어라.

$\gcd(3, 18) = 3 \neq 1$이므로 정리 1.37을 적용할 수 없다(REM 2에서 본 것처럼 이 경우 해는 유일하지 않을 수 있다). $18 \mid 3x$인 것은 $6 \mid x$인 것과 동치이므로, $0 \le x \lt 18$ 범위에서 $6$의 배수인 $x$를 모두 찾으면 된다. 따라서 해는

$$x \equiv 0, 6, 12 \ (\bmod\ 18)$$

세 개이다.

English

Solve $3x \equiv 0 \ (\bmod\ 18)$.

Since $\gcd(3, 18) = 3 \neq 1$, Theorem 1.37 does not apply (as in Remark 2, the solution need not be unique in this case). Since $18 \mid 3x$ if and only if $6 \mid x$, it suffices to find all multiples of $6$ with $0 \le x \lt 18$. So the solutions are

$$x \equiv 0, 6, 12 \ (\bmod\ 18)$$

and there are three of them.

EX 1.42 CRT 알고리즘으로 연립합동식 풀기 Solving Systems by the CRT Algorithm
한국어

CRT 알고리즘으로 연립합동식을 풀어라.

1. $x \equiv 2 \ (\bmod\ 3)$, $x \equiv 4 \ (\bmod\ 5)$, $x \equiv 6 \ (\bmod\ 7)$

2. $x \equiv 2 \ (\bmod\ 3)$, $x \equiv 4 \ (\bmod\ 5)$, $x \equiv 2 \ (\bmod\ 7)$

두 경우 모두 $m_1 = 3, m_2 = 5, m_3 = 7$이므로 알고리즘(ALGO, 중국인의 나머지 정리 알고리즘)의 1단계에 의해 $M = m_1m_2m_3 = 105$이고

$$M_1 = \frac{M}{m_1} = 35, \qquad M_2 = \frac{M}{m_2} = 21, \qquad M_3 = \frac{M}{m_3} = 15.$$

2단계에서 $N_i$는 법 $m_i$에 대한 $M_i$의 역원이다. $M_1 = 35 \equiv 2 \ (\bmod\ 3)$이고 $2^{-1} \equiv 2 \ (\bmod\ 3)$이므로 $N_1 = 2$이다. $M_2 = 21 \equiv 1 \ (\bmod\ 5)$이므로 $N_2 = 1$이다. $M_3 = 15 \equiv 1 \ (\bmod\ 7)$이므로 $N_3 = 1$이다.

1. $a_1 = 2, a_2 = 4, a_3 = 6$이므로 3단계에 의해

$$x \equiv a_1N_1M_1 + a_2N_2M_2 + a_3N_3M_3 \equiv 2 \cdot 2 \cdot 35 + 4 \cdot 1 \cdot 21 + 6 \cdot 1 \cdot 15 \equiv 140 + 84 + 90 \equiv 314 \equiv 104 \ (\bmod\ 105).$$

확인: $104 \equiv 2 \ (\bmod\ 3)$, $104 \equiv 4 \ (\bmod\ 5)$, $104 \equiv 6 \ (\bmod\ 7)$이다.

2. $a_1 = 2, a_2 = 4, a_3 = 2$이므로

$$x \equiv 2 \cdot 2 \cdot 35 + 4 \cdot 1 \cdot 21 + 2 \cdot 1 \cdot 15 \equiv 140 + 84 + 30 \equiv 254 \equiv 44 \ (\bmod\ 105).$$

확인: $44 \equiv 2 \ (\bmod\ 3)$, $44 \equiv 4 \ (\bmod\ 5)$, $44 \equiv 2 \ (\bmod\ 7)$이다.

English

Solve the system by the algorithm CRT.

1. $x \equiv 2 \ (\bmod\ 3)$, $x \equiv 4 \ (\bmod\ 5)$ and $x \equiv 6 \ (\bmod\ 7)$

2. $x \equiv 2 \ (\bmod\ 3)$, $x \equiv 4 \ (\bmod\ 5)$ and $x \equiv 2 \ (\bmod\ 7)$

In both cases $m_1 = 3, m_2 = 5, m_3 = 7$, so by step 1 of the algorithm (ALGO, Chinese remainder theorem algorithm), $M = m_1m_2m_3 = 105$ and

$$M_1 = \frac{M}{m_1} = 35, \qquad M_2 = \frac{M}{m_2} = 21, \qquad M_3 = \frac{M}{m_3} = 15.$$

In step 2, $N_i$ is the inverse of $M_i$ modulo $m_i$. Since $M_1 = 35 \equiv 2 \ (\bmod\ 3)$ and $2^{-1} \equiv 2 \ (\bmod\ 3)$, $N_1 = 2$. Since $M_2 = 21 \equiv 1 \ (\bmod\ 5)$, $N_2 = 1$. Since $M_3 = 15 \equiv 1 \ (\bmod\ 7)$, $N_3 = 1$.

1. Since $a_1 = 2, a_2 = 4, a_3 = 6$, by step 3

$$x \equiv a_1N_1M_1 + a_2N_2M_2 + a_3N_3M_3 \equiv 2 \cdot 2 \cdot 35 + 4 \cdot 1 \cdot 21 + 6 \cdot 1 \cdot 15 \equiv 140 + 84 + 90 \equiv 314 \equiv 104 \ (\bmod\ 105).$$

Check: $104 \equiv 2 \ (\bmod\ 3)$, $104 \equiv 4 \ (\bmod\ 5)$, $104 \equiv 6 \ (\bmod\ 7)$.

2. Since $a_1 = 2, a_2 = 4, a_3 = 2$,

$$x \equiv 2 \cdot 2 \cdot 35 + 4 \cdot 1 \cdot 21 + 2 \cdot 1 \cdot 15 \equiv 140 + 84 + 30 \equiv 254 \equiv 44 \ (\bmod\ 105).$$

Check: $44 \equiv 2 \ (\bmod\ 3)$, $44 \equiv 4 \ (\bmod\ 5)$, $44 \equiv 2 \ (\bmod\ 7)$.

EX 1.43 x² + 1 ≡ 0 (mod 85) 풀기 Solving x² + 1 ≡ 0 (mod 85)
한국어

$x^2 + 1 \equiv 0 \ (\bmod\ 85)$를 풀어라.

$85 = 5 \times 17$이므로 중국인의 나머지 정리(정리 1.39)에 의해 $x^2 + 1 \equiv 0 \ (\bmod\ 85)$인 것은 $x^2 \equiv -1 \ (\bmod\ 5)$이고 $x^2 \equiv -1 \ (\bmod\ 17)$인 것과 동치이다. 법 5에서 $2^2 = 4 \equiv -1$, $3^2 = 9 \equiv 4 \equiv -1$이므로 $x \equiv 2, 3 \ (\bmod\ 5)$이다. 법 17에서 $4^2 = 16 \equiv -1$, $13^2 = 169 = 170 - 1 \equiv -1$이므로 $x \equiv 4, 13 \ (\bmod\ 17)$이다.

네 조합을 CRT 알고리즘으로 결합하자. $M = 85, M_1 = 17, M_2 = 5$이고, $N_1$은 법 5에 대한 $17$의 역원, $N_2$는 법 17에 대한 $5$의 역원이다. $17 \equiv 2 \ (\bmod\ 5)$이고 $2 \times 3 \equiv 1 \ (\bmod\ 5)$이므로 $N_1 = 3$이다. $5 \times 7 = 35 = 34 + 1 \equiv 1 \ (\bmod\ 17)$이므로 $N_2 = 7$이다. 즉 $x \equiv a_1 \cdot 3 \cdot 17 + a_2 \cdot 7 \cdot 5 \ (\bmod\ 85)$이다.

$$\begin{aligned} (x \equiv 2 \ (\bmod\ 5),\ x \equiv 4 \ (\bmod\ 17)) &: x \equiv 2 \cdot 3 \cdot 17 + 4 \cdot 7 \cdot 5 \equiv 102 + 140 \equiv 242 \equiv 72 \ (\bmod\ 85) \\ (x \equiv 2 \ (\bmod\ 5),\ x \equiv 13 \ (\bmod\ 17)) &: x \equiv 102 + 455 \equiv 557 \equiv 47 \ (\bmod\ 85) \\ (x \equiv 3 \ (\bmod\ 5),\ x \equiv 4 \ (\bmod\ 17)) &: x \equiv 153 + 140 \equiv 293 \equiv 38 \ (\bmod\ 85) \\ (x \equiv 3 \ (\bmod\ 5),\ x \equiv 13 \ (\bmod\ 17)) &: x \equiv 153 + 455 \equiv 608 \equiv 13 \ (\bmod\ 85) \end{aligned}$$

따라서 해는 $x \equiv 13, 38, 47, 72 \ (\bmod\ 85)$이다. 예를 들어 $13^2 + 1 = 170 = 2 \times 85$로 확인된다.

English

Solve the equation $x^2 + 1 \equiv 0 \ (\bmod\ 85)$.

Since $85 = 5 \times 17$, by the Chinese remainder theorem (Theorem 1.39), $x^2 + 1 \equiv 0 \ (\bmod\ 85)$ is equivalent to $x^2 \equiv -1 \ (\bmod\ 5)$ and $x^2 \equiv -1 \ (\bmod\ 17)$. Modulo 5, $2^2 = 4 \equiv -1$ and $3^2 = 9 \equiv 4 \equiv -1$, so $x \equiv 2, 3 \ (\bmod\ 5)$. Modulo 17, $4^2 = 16 \equiv -1$ and $13^2 = 169 = 170 - 1 \equiv -1$, so $x \equiv 4, 13 \ (\bmod\ 17)$.

Combine the four cases by the CRT algorithm. $M = 85, M_1 = 17, M_2 = 5$, and $N_1$ is the inverse of $17$ modulo $5$, $N_2$ is the inverse of $5$ modulo $17$. Since $17 \equiv 2 \ (\bmod\ 5)$ and $2 \times 3 \equiv 1 \ (\bmod\ 5)$, $N_1 = 3$. Since $5 \times 7 = 35 = 34 + 1 \equiv 1 \ (\bmod\ 17)$, $N_2 = 7$. So $x \equiv a_1 \cdot 3 \cdot 17 + a_2 \cdot 7 \cdot 5 \ (\bmod\ 85)$.

$$\begin{aligned} (x \equiv 2 \ (\bmod\ 5),\ x \equiv 4 \ (\bmod\ 17)) &: x \equiv 2 \cdot 3 \cdot 17 + 4 \cdot 7 \cdot 5 \equiv 102 + 140 \equiv 242 \equiv 72 \ (\bmod\ 85) \\ (x \equiv 2 \ (\bmod\ 5),\ x \equiv 13 \ (\bmod\ 17)) &: x \equiv 102 + 455 \equiv 557 \equiv 47 \ (\bmod\ 85) \\ (x \equiv 3 \ (\bmod\ 5),\ x \equiv 4 \ (\bmod\ 17)) &: x \equiv 153 + 140 \equiv 293 \equiv 38 \ (\bmod\ 85) \\ (x \equiv 3 \ (\bmod\ 5),\ x \equiv 13 \ (\bmod\ 17)) &: x \equiv 153 + 455 \equiv 608 \equiv 13 \ (\bmod\ 85) \end{aligned}$$

So the solutions are $x \equiv 13, 38, 47, 72 \ (\bmod\ 85)$. For example, $13^2 + 1 = 170 = 2 \times 85$ confirms this.

1.8 Euler φ function · 오일러 φ 함수

DEF 1.44 오일러 φ 함수 The Euler phi Function
한국어

양의 정수 $n$이 주어졌을 때, $\phi(n)$은 $1 \le a \le n$이고 $\gcd(a, n) = 1$인 $a$의 개수를 나타낸다. 함수 $\phi$를 오일러 $\phi$ 함수라 한다.

English

Given a positive integer $n$, let $\phi(n)$ denote the number of $a$ such that $1 \le a \le n$ and $\gcd(a, n) = 1$. The function $\phi$ is called the Euler $phi$ function.

REM 3 φ(n)이 세는 것 φ(n) Counts the Invertible Residues
한국어

양의 정수 $n$에 대하여 정수 $\phi(n)$은 법 $n$에 대하여 가역인 $a(1 \le a \le n)$의 개수를 나타낸다.

English

For a positive integer $n$, the integer $\phi(n)$ denotes the number of invertible $a(1 \le a \le n)$ modulo $n$.

EXAM 1.45 φ(12)의 계산 Calculating φ(12)
한국어

$\phi(12)$를 계산해 보자. $\gcd(a, 12) = 1$이려면 $a$는 2의 배수도 3의 배수도 아니어야 한다. 그러므로 $1 \le a \le 12$이고 $\gcd(a, 12) = 1$인 가능한 $a$는 $1, 5, 7, 11$이다. 따라서 $\phi(12) = 4$이다.

English

Let’s calculate $\phi(12)$. With $\gcd(a, 12) = 1$, an $a$ must not be a multiple of 2 and 3. So possible $a$ such that $1 \le a \le 12$ and $\gcd(a, 12) = 1$ is $1, 5, 7, 11$. Therefore $\phi(12) = 4$.

NOTE
한국어

$n \in \mathbb{N}$에 대하여 $\phi(n)$의 값을 어떻게 구할 것인가? 이 문제를 다음 단계로 살펴본다.

1. 소수 $p$와 $n \in \mathbb{Z}_{>0}$에 대하여 $\phi(p^n)$을 계산한다

2. $\phi(p_1^{k_1} \cdots p_m^{k_m})$을 계산한다.

예를 들어 $\phi(9) = \phi(3^2)$이다. $\gcd(a, 9) = 1$인 것은 $\gcd(a, 3) = 1$인 것과 동치임에 주의하자. 다시 말해 $\gcd(a, 9) \gt 1$인 것은 어떤 $l \in \mathbb{N}$에 대하여 $a = 3l$인 것과 동치이다. 그러므로 $1 \le a \le 9$이고 $\gcd(a, 9) \gt 1$인 수는 $3, 6, 9$뿐이다. 따라서 $\phi(9) = 9 - 3 = 6$이다.

English

How to find the value of $\phi(n)$ for $n \in \mathbb{N}$? We consider this question as the following steps :

1. Calculate $\phi(p^n)$ for prime $p$ and $n \in \mathbb{Z}_{>0}$

2. Calculate $\phi(p_1^{k_1} \cdots p_m^{k_m})$.

For example, $\phi(9) = \phi(3^2)$. Note that $\gcd(a, 9) = 1$ if and only if $\gcd(a, 3) = 1$. In other words, $\gcd(a, 9) \gt 1$ if and only if $a = 3l$ for $l \in \mathbb{N}$. So $3, 6$, and $9$ are the only number for which $\gcd(a, 9 \gt 1$ and $1 \le a \le 9$. So $\phi(9) = 9 - 3 = 6$.

THM 1.46 소수 거듭제곱에서의 φ 값 The Value of φ(p^k)
한국어

$p$가 소수이고 $k \in \mathbb{N}$이라 하자. 그러면 $\phi(p^k) = p^{k-1}(p - 1)$이다.

$\gcd(n, p^k) = 1$인 것은 $\gcd(n, p) = 1$인 것과 동치임에 주의하자. 따라서 $\phi(p^k)$는 $\gcd(a, p) = 1$인 $a$ $(1 \le a \le p^k)$의 개수이다. 그러므로 $p^k - \phi(p^k)$는 $\gcd(a, p) = p$인 $a$ $(1 \le a \le p^k)$의 개수이다. 다시 말해 이는 $p^k$ 이하인 $p$의 배수의 개수이다. 이는 $p, 2p, \cdots, p^{k-1}p = p^k$의 개수이다. 그러므로 $p^k - \phi(p^k) = p^{k-1}$이고, $\phi(p^k) = p^k - p^{k-1} = p^{k-1}(p - 1)$이다.

역주. 원문은 마지막 등식을 "$p, 2p, \cdots, p^{k-1}p = p^{k-1}$"로 적었으나 $p^{k-1}p = p^k$이므로(그 개수가 $p^{k-1}$개) 위에서 바로잡아 옮겼다. 또한 원문은 두 곳의 범위를 "$1 \le a \le n$"으로 적었으나 이 정리에는 $n$이 등장하지 않으므로 $1 \le a \le p^k$의 오타이다.

English

Let $p$ be a prime and $k \in \mathbb{N}$. Then $\phi(p^k) = p^{k-1}(p - 1)$.

Note that $\gcd(n, p^k) = 1$ if and only if $\gcd(n, p) = 1$. Therefore $\phi(p^k)$ is the number of $a$ $(1 \le a \le n)$ such that $\gcd(a, p) = 1$. So $p^k - \phi(p^k)$ is the number of $a$ $(1 \le a \le n)$ such that $\gcd(a, p) = p$. In other words, it is the number of the multiple of $p$ below $p^k$. It is the number of $p, 2p, \cdots, p^{k-1}p = p^{k-1}$. So $p^k - \phi(p^k) = p^{k-1}$, $\phi(p^k) = p^k - p^{k-1} = p^{k-1}(p - 1)$.

NOTE
한국어

$n = p_1^{a_1} \cdots p_m^{a_m}$을 양의 정수 $n$의 소인수분해라 하자.

English

Let $n = p_1^{a_1} \cdots p_m^{a_m}$ be the prime factorization of the positive integer $n$.

THM 1.47 서로소인 두 수에서의 곱셈성 φ(mn) = φ(m)φ(n) for Relatively Prime m and n
한국어

$m$과 $n$이 서로소인 양의 정수라 하자. 그러면 $\phi(mn) = \phi(m)\phi(n)$이다.

English

Let $m$ and $n$ be relatively prime positive integers. Then $\phi(mn) = \phi(m)\phi(n)$.

NOTE
한국어

위 정리에 의해 $\phi(p_1^{a_1} \cdots p_m^{a_m}) = \phi(p_1^{a_1}) \cdots \phi(p_m^{a_m})$임을 안다. 예를 들어 $\phi(540)$을 계산해 보자. $540 = 2^2 3^3 5$임에 주의하자. 그러면 $\phi(540) = \phi(2^2)\phi(3^3)\phi(5) = 2(2 - 1) \cdot 3^2(3 - 1) \cdot (5 - 1) = 144$이다.

English

Since above theorem, we know that $\phi(p_1^{a_1} \cdots p_m^{a_m}) = \phi(p_1^{a_1}) \cdots \phi(p_m^{a_m})$. For example, calculate $\phi(540)$. Note that $540 = 2^2 3^3 5$. Then $\phi(540) = \phi(2^2)\phi(3^3)\phi(5) = 2(2 - 1) \cdot 3^2(3 - 1) \cdot (5 - 1) = 144$.

REM 4 서로소 가정이 필요한 이유 The Assumption (m, n) = 1 Is Necessary
한국어

$\phi(3)\phi(3) = 2 \times 2 = 4$이고 $\phi(3^2) = 3(3 - 1) = 6$임에 주의하자. 위 정리는 가정 $(m, n) = 1$이 없으면 성립하지 않는다.

English

Note that $\phi(3)\phi(3) = 2 \times 2 = 4$ and $\phi(3^2) = 3(3 - 1) = 6$. The above theorem is false without assumption $(m, n) = 1$.

THM 1.48 소인수분해로 구하는 φ(n) φ(n) from the Prime Factorization of n
한국어

$n = p_1^{a_1} \cdots p_m^{a_m}$을 양의 정수 $n$의 소인수분해라 하자. 그러면

$$\phi(n) = \prod_{i=1}^{k} p_i^{a_i - 1}(p_i - 1) = n\prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right)$$
$$\begin{aligned} \phi(n) &= \phi(p_1^{a_1} \cdots p_k^{a_k}) \\ &= \phi(p_1^{a_1}) \cdots \phi(p_k^{a_k}) \\ &= p_1^{a_1 - 1}(p_1 - 1) \cdots p_k^{a_k - 1}(p_k - 1) \\ &= np_1^{-1}(p_1 - 1) \cdots p_k^{-1}(p_k - 1) \\ &= n\prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right) \end{aligned}$$
English

Let $n = p_1^{a_1} \cdots p_m^{a_m}$ be the prime factorization of the positive integer $n$. Then

$$\phi(n) = \prod_{i=1}^{k} p_i^{a_i - 1}(p_i - 1) = n\prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right)$$
$$\begin{aligned} \phi(n) &= \phi(p_1^{a_1} \cdots p_k^{a_k}) \\ &= \phi(p_1^{a_1}) \cdots \phi(p_k^{a_k}) \\ &= p_1^{a_1 - 1}(p_1 - 1) \cdots p_k^{a_k - 1}(p_k - 1) \\ &= np_1^{-1}(p_1 - 1) \cdots p_k^{-1}(p_k - 1) \\ &= n\prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right) \end{aligned}$$
NOTE
한국어

$n, a \in \mathbb{N}$이 주어졌을 때 $a^m \equiv 1 \ (\bmod\ n)$을 만족하는 $m \in \mathbb{N}$을 구하자. 이제 이 문제를 살펴볼 것이다.

English

For given $n, a \in \mathbb{N}$, find $m \in \mathbb{N}$ such that $a^m \equiv 1 \ (\bmod\ n)$. We will study about above question.

DEF 1.49 법 n에 대한 a의 위수 The Order of a Modulo n
한국어

$\gcd(a, n) = 1$인 $a, n \in \mathbb{N}$이라 하자. 법 $n$에 대한 $a$의 위수는 $a^k \equiv 1 \ (\bmod\ n)$을 만족하는 최소의 양의 정수 $k$이다.

English

Assume that $a, n \in \mathbb{N}$ such that $\gcd(a, n) = 1$. The order of $a$ modulo $n$ is the least positive integer $k$ such that $a^k \equiv 1 \ (\bmod\ n)$.

EXAM 1.50 위수의 계산 예 Computing Orders Modulo 5 and 11
한국어

1. 법 $n$에 대한 1의 위수는 1이다.

2. 법 5에 대한 2의 위수를 생각해 보자.

$n$1234
$2^n(\bmod\ 5)$2431

따라서 법 5에 대한 2의 위수는 4이다.

3. 법 11에 대한 2의 위수를 생각해 보자.

$n$12345678910
$2^n(\bmod\ 11)$24851097361

따라서 법 11에 대한 2의 위수는 10이다.

역주. 원문 표의 머리글은 "$2^n(\bmod\ 1)$"로 인쇄되어 있으나, 법 11에 대한 위수를 구하는 예이므로 $2^n(\bmod\ 11)$의 오타이다.

English

1. The order of 1 modulo $n$ is 1.

2. Think about order of 2 mod 5.

$n$1234
$2^n(\bmod\ 5)$2431

Therefore the order of 2 mod 5 is 4.

3. Think about order of 2 mod 11.

$n$12345678910
$2^n(\bmod\ 1)$24851097361

Therefore the order of 2 mod 11 is 10.

THM 1.51 위수와 지수의 관계 The Order of a Modulo n and Exponents
한국어

$a$와 $n$이 $\gcd(a,n)=1$인 양의 정수라 하고 $t$를 법 $n$에 대한 $a$의 위수라 하자. 그러면 임의의 $m \in \mathbb{N}$에 대하여 $a^m \equiv 1 \ (\bmod\ n)$인 것은 $t \mid m$인 것과 동치이다.

역주. 원문 진술은 "$a$와 $n$이 양의 정수이고 $\gcd(a,n)=1$이다"에서 결론 없이 끝난다. 아래 증명 내용에 따라 결론을 보충하여 옮겼다.

$t$를 법 $n$에 대한 $a$의 위수라 하자.

$\Rightarrow$) $a^m \equiv 1 \ (\bmod\ n)$이라 하자. 그러면 어떤 정수 $q$와 $0 \le r \lt t$에 대하여 $m = qt + r$이다. $1 \equiv a^m \equiv a^{qt+r} \equiv a^{qt}a^r \equiv (a^t)^q a^r \equiv a^r \ (\bmod\ n)$임을 안다. 법 $n$에 대한 $a$의 위수의 정의에 의해 $r = 0$임을 쉽게 확인할 수 있다. 따라서 $t|m$이다.

$\Leftarrow$) $m = tq$라 하자. 그러면 $a^m \equiv (a^t)^q \equiv 1^q \equiv 1 \ (\bmod\ n)$이다. 이제 증명이 끝났다.

역주. 원문은 두 갈래의 라벨을 모두 "⇒)"로 적었으나 둘째 갈래는 "⇐)"이다. 또한 원문은 첫째 갈래에서 이탤릭 단어로 인쇄된 "$aqtar$"를 적었으나 뜻은 $a^{qt}a^r$이고, 둘째 갈래에서 "$a^m \equiv a^tq$"로 적었으나 뜻은 $a^m \equiv (a^t)^q$이다. 위에서 모두 바로잡아 옮겼다.

English

Let $a$ and $n$ be positive integers such that $\gcd(a, n) = 1$.

Let $t$ be the order of $a$ modulo $n$.

$\Rightarrow$) Assume that $a^m \equiv 1 \ (\bmod\ n)$. Then $m = qt + r$ for some integer $q$ and $0 \le r \lt t$. We know that $1 \equiv a^m \equiv a^{qt+r} \equiv aqtar \equiv (a^t)^q a^r \equiv a^r \ (\bmod\ n)$. By definition of the order of $a$ modulo $n$, we can easily check that $r = 0$. Therefore $t|m$.

$\Rightarrow$) Assume that $m = tq$. Then $a^m \equiv a^t q \equiv (a^t)^q \equiv 1^q \equiv 1 \ (\bmod\ n)$. Now we are done.

COR 1.52 서로 다른 거듭제곱 1, a, ⋯, a^(t−1) Are Distinct Modulo n
한국어

$a$와 $n$이 양의 정수라 하자. $t$를 법 $n$에 대한 $a$의 위수라 하자. 그러면 $1, a, \cdots, a^{t-1}$은 법 $n$에 대하여 서로 다른 정수이다.

$0 \le s \lt r \lt t$라 하자. 만약 $a^r \equiv a^s \ (\bmod\ n)$이면 $t|r - s$이다. $0 \lt r - s \lt t$이므로 이는 모순이다.

English

Let $a$ and $n$ be positive integers. Let $t$ be the order of $a$ mod $n$. Then $1, a, \cdots, a^{t-1}$ are distinct integers modulo $n$.

Assume that $0 \le s \lt r \lt t$. If $a^r \equiv a^s \ (\bmod\ n)$, then $t|r - s$. Since $0 \lt r - s \lt t$, it is a contradiction.

EX 1.53 φ(2010)의 계산 Calculating φ(2010)
한국어

$\phi(2010)$을 계산하라.

$2010 = 2 \times 3 \times 5 \times 67$이고 $2, 3, 5, 67$은 모두 소수이다. 정리 1.48에 의해

$$\phi(2010) = \phi(2)\phi(3)\phi(5)\phi(67) = 1 \times 2 \times 4 \times 66 = 528.$$
English

Calculate $\phi(2010)$.

$2010 = 2 \times 3 \times 5 \times 67$, and $2, 3, 5, 67$ are all prime. By Theorem 1.48,

$$\phi(2010) = \phi(2)\phi(3)\phi(5)\phi(67) = 1 \times 2 \times 4 \times 66 = 528.$$
EX 1.54 φ(mn) ≠ φ(m)φ(n)인 예 An Example with φ(mn) ≠ φ(m)φ(n)
한국어

$\phi(mn) \neq \phi(m)\phi(n)$인 예를 들어라.

$m = n = 2$로 두자. 정리 1.46에 의해 $\phi(4) = \phi(2^2) = 2^1(2 - 1) = 2$인 반면 $\phi(2)\phi(2) = 1 \times 1 = 1$이므로

$$\phi(mn) = \phi(4) = 2 \neq 1 = \phi(2)\phi(2) = \phi(m)\phi(n).$$

(REM 4에서 본 $\phi(3)\phi(3) = 4 \neq 6 = \phi(9)$도 같은 성질의 예이다.) 정리 1.47이 $\gcd(m, n) = 1$이라는 가정을 두는 것은 바로 이 때문이다: $m, n$이 서로소가 아니면 곱셈성이 깨진다.

English

Give an example s.t. $\phi(mn) \neq \phi(m)\phi(n)$.

Let $m = n = 2$. By Theorem 1.46, $\phi(4) = \phi(2^2) = 2^1(2 - 1) = 2$, while $\phi(2)\phi(2) = 1 \times 1 = 1$, so

$$\phi(mn) = \phi(4) = 2 \neq 1 = \phi(2)\phi(2) = \phi(m)\phi(n).$$

(The example $\phi(3)\phi(3) = 4 \neq 6 = \phi(9)$ from Remark 4 is of the same kind.) This is exactly why Theorem 1.47 requires the assumption $\gcd(m, n) = 1$: multiplicativity fails when $m$ and $n$ are not relatively prime.

EX 1.55 φ의 값이 되지 않는 최소의 양의 정수 The Least Positive Integer That Is Not a Value of φ
한국어

모든 $n \in \mathbb{N}$에 대하여 $\phi(n) \neq a$를 만족하는 최소의 양의 정수 $a$를 구하라.

답은 $a = 3$이다.

$\phi(1) = 1$, $\phi(2) = 1$, $\phi(3) = 2$이므로 $1$과 $2$는 모두 $\phi$의 값으로 나타난다. 이제 $n \ge 3$이면 $\phi(n)$이 항상 짝수임을 보이자.

$n$이 홀수인 소수 $p$로 나누어떨어진다고 하자. $p^k \| n$인 $k \ge 1$을 잡으면 $\gcd(p^k, n/p^k) = 1$이므로 정리 1.47과 정리 1.46에 의해

$$\phi(n) = \phi(p^k)\phi(n/p^k) = p^{k-1}(p - 1)\phi(n/p^k)$$

이고, $p$가 홀수이므로 $p - 1$은 짝수이다. 따라서 $\phi(n)$은 짝수이다.

$n$이 홀수인 소인수를 갖지 않으면 $n = 2^k$ 꼴이고, $n \ge 3$이므로 $k \ge 2$이다. 정리 1.46에 의해 $\phi(n) = \phi(2^k) = 2^{k-1}(2 - 1) = 2^{k-1}$이고 $k - 1 \ge 1$이므로 이 역시 짝수이다.

따라서 $n \ge 3$인 모든 $n$에 대해 $\phi(n)$은 짝수이므로 $\phi(n) = 3$을 만족하는 $n$은 존재하지 않는다. $1$과 $2$는 값으로 나타나므로, $\phi$의 값이 되지 않는 최소의 양의 정수는 $a = 3$이다.

English

Find the least positive integer $a$ such that for every $n \in \mathbb{N}$, $\phi(n) \neq a$.

The answer is $a = 3$.

Since $\phi(1) = 1$, $\phi(2) = 1$, $\phi(3) = 2$, both $1$ and $2$ occur as values of $\phi$. We now show that $\phi(n)$ is always even for $n \ge 3$.

Suppose $n$ is divisible by an odd prime $p$. Take $k \ge 1$ with $p^k \| n$. Since $\gcd(p^k, n/p^k) = 1$, by Theorem 1.47 and Theorem 1.46,

$$\phi(n) = \phi(p^k)\phi(n/p^k) = p^{k-1}(p - 1)\phi(n/p^k)$$

and since $p$ is odd, $p - 1$ is even. Hence $\phi(n)$ is even.

If $n$ has no odd prime factor, then $n = 2^k$, and since $n \ge 3$, $k \ge 2$. By Theorem 1.46, $\phi(n) = \phi(2^k) = 2^{k-1}(2 - 1) = 2^{k-1}$, and since $k - 1 \ge 1$, this is also even.

So $\phi(n)$ is even for every $n \ge 3$, hence no $n$ satisfies $\phi(n) = 3$. Since $1$ and $2$ both occur as values, the least positive integer that is not a value of $\phi$ is $a = 3$.

EX 1.56 법 524에 대하여 가역인 수의 개수 Counting the Invertible a Modulo 524
한국어

법 524에 대하여 가역인 $a$ $(1 \le a \le 524)$의 개수를 구하라.

$524 = 2^2 \times 131$이고 $131$은 소수이다($11$ 이하의 모든 소수 $2, 3, 5, 7, 11$로 나누어보면 확인된다). REM 3에 의해 법 524에 대하여 가역인 $a$ $(1 \le a \le 524)$의 개수는 $\phi(524)$와 같다. 정리 1.48에 의해

$$\phi(524) = \phi(2^2)\phi(131) = 2(2 - 1) \times 130 = 2 \times 130 = 260.$$

따라서 구하는 개수는 $260$이다.

English

Find the number of invertible $a$ $(1 \le a \le 524)$ modulo 524.

$524 = 2^2 \times 131$, and $131$ is prime (checking division by every prime $2, 3, 5, 7, 11$ up to $11$ confirms this). By Remark 3, the number of invertible $a$ $(1 \le a \le 524)$ modulo 524 equals $\phi(524)$. By Theorem 1.48,

$$\phi(524) = \phi(2^2)\phi(131) = 2(2 - 1) \times 130 = 2 \times 130 = 260.$$

So the number is $260$.

EX 1.57 법 18에 대한 7의 위수 The Order of 7 Modulo 18
한국어

법 18에 대한 7의 위수를 구하라.

$7^2 = 49 \equiv 13 \ (\bmod\ 18)$이고 $7^3 \equiv 13 \times 7 = 91 \equiv 1 \ (\bmod\ 18)$이다($91 = 5 \times 18 + 1$). $7^1 = 7 \not\equiv 1$이고 $7^2 = 13 \not\equiv 1$이므로 법 18에 대한 7의 위수는 $3$이다. $\phi(18) = 6$이고 $3 \mid 6$이므로 정리 1.51과도 일치한다.

English

Find the order of 7 modulo 18.

$7^2 = 49 \equiv 13 \ (\bmod\ 18)$ and $7^3 \equiv 13 \times 7 = 91 \equiv 1 \ (\bmod\ 18)$ (since $91 = 5 \times 18 + 1$). Since $7^1 = 7 \not\equiv 1$ and $7^2 = 13 \not\equiv 1$, the order of 7 modulo 18 is $3$. Since $\phi(18) = 6$ and $3 \mid 6$, this is consistent with Theorem 1.51.

1.9 Primitive root of mod n · 법 n의 원시근

DEF 1.58 법 n의 원시근 A Primitive Root of mod n
한국어

정수 $a$가 법 $n$의 원시근이라는 것은 법 $n$에 대한 $a$의 위수가 $\phi(n)$인 것이다.

English

The integer $a$ is called a primitive root of mod $n$ if the order of $a$ mod $n$ is $\phi(n)$.

EXAM 1.59 법 5, 7, 8에서의 원시근 Primitive Roots of mod 5, 7 and 8
한국어

1. 법 5에 대한 2의 위수는 4이다. $\phi(5) = 5 - 1 = 4$임에 주의하자. 따라서 2는 법 5의 원시근이다.

2. 법 7에 대한 2의 위수는 3이다. $\phi(7) = 7 - 1 = 6$임에 주의하자. 따라서 2는 법 7의 원시근이 아니다. 3이 소수이므로 3이 법 7에 대한 2의 위수임을 관찰할 수 있다.

3. 법 8의 원시근은 존재하지 않는다. $1^2 \equiv 3^2 \equiv 5^2 \equiv 7^2 \equiv 1 \ (\bmod\ 8)$이기 때문이다.

English

1. The order of 2 mod 5 is 4. Note that $\phi(5) = 5 - 1 = 4$. Therefore 2 is a primitive root of mod 5.

2. The order of 2 mod 7 is 3. Note that $\phi(7) = 7 - 1 = 6$. Therefor 2 is not a primitive root of mod 7. Since 3 is prime, we can observe that 3 is the order of 2 modulo 7.

3. There is no primitive root of mod 8. Because $1^2 \equiv 3^2 \equiv 5^2 \equiv 7^2 \equiv 1 \ (\bmod\ 8)$.

THM 1.60 원시근이 존재할 조건 When a Primitive Root of Modulo n Exists
한국어

법 $n$의 원시근이 존재하는 것은 어떤 홀수인 소수 $p$와 양의 정수 $k$에 대하여 $n = 2, 4, p^k$ 또는 $2p^k$인 것과 동치이다.

역주. 원문은 "소수 $p$"라고만 적었으나 $p$는 홀수인 소수여야 한다. $p = 2$까지 허용하면 $n = 2^3 = 8$이 $p^k$ 꼴이 되어 법 8의 원시근이 존재한다는 결론이 나오지만, 예제 1.59 (3)에서 보았듯 법 8의 원시근은 존재하지 않는다. 위에서 바로잡아 옮겼다.

English

There is a primitive root of modulo $n$ if and only if $n = 2, 4, p^k$ or $2p^k$ for some prime $p$ and positive integer $k$.

NOTE
한국어

(아르틴 추측) $a (a \gt 1)$가 정수라 하자. $a$가 법 $p$의 원시근이 되는 소수 $p$가 무한히 많다.

English

(Artin conjecture) Let $a(a \gt 1)$ be an integer. There are infinitely many primes $p$ s.t. $a$ is a primitive root of modulo $p$.

THM 1.61 오일러 정리 Euler's Theorem
한국어

$a$와 $n$이 양의 정수라 하자. $\gcd(a, n) = 1$이라 가정하자. 그러면 $a^{\phi(n)} \equiv 1 \ (\bmod\ n)$이다.

English

Let $a$ and $n$ be positive integers. Suppose that $\gcd(a, n) = 1$. Then $a^{\phi(n)} \equiv 1 \ (\bmod\ n)$.

NOTE
한국어

법 7에 대하여 정리를 확인해 보자.

$x$$x^2$$x^3$$x^4$$x^5$$x^6$
1111111
2241241
3326451
4421421
5546231
6616161

그러면 3과 5는 법 7의 원시근이다.

English

Let’s confirm the theorem for mod 7.

$x$$x^2$$x^3$$x^4$$x^5$$x^6$
1111111
2241241
3326451
4421421
5546231
6616161

Then 3 and 5 are primitive root of modulo 7.

THM 1.62 페르마 소정리 Fermat Little Theorem
한국어

$p$가 소수이고 $a$가 $\gcd(a, p) = 1$인 정수이면 $a^{p-1} \equiv 1 \ (\bmod\ p)$이다.

오일러 정리에 의해 $a^{\phi(p)} \equiv a^{p-1} \equiv 1 \ (\bmod\ p)$임을 쉽게 확인할 수 있다.

English

If $p$ is a prime and $a$ is an integer with $\gcd(a, p) = 1$, then $a^{p-1} \equiv 1 \ (\bmod\ p)$.

By the Euler’s theorem, we can easily check that $a^{\phi(p)} \equiv a^{p-1} \equiv 1 \ (\bmod\ p)$.

EXAM 1.63 큰 거듭제곱의 나머지 계산 Computing 3^205 (mod 101) and 5^10000 (mod 18)
한국어

1. $3^{205} \ (\bmod\ 101)$을 구하자. 페르마 소정리에 의해 $3^{\phi(101)} \equiv 3^{100} \equiv 1 \ (\bmod\ 101)$이다. 따라서

$$3^{205} \equiv 3^{200}3^5 \equiv 3^5 \equiv 243 \equiv 41 \ (\bmod\ 101).$$

2. $5^{10000} \ (\bmod\ 18)$을 구하자. $\phi(18) = 6$임에 주의하자. 오일러 정리에 의해 $5^6 \equiv 1 \ (\bmod\ 18)$이다. 따라서

$$5^{10000} \equiv 5^4 \equiv 25^2 \equiv 7^2 \equiv 13 \ (\bmod\ 18).$$

역주. 원문은 "$243 \equiv 38 \ (\bmod\ 101)$"로 계산했으나 $243 - 2 \cdot 101 = 41$이므로 $3^5 \equiv 41 \ (\bmod\ 101)$이다. 위에서 바로잡아 옮겼다.

English

1. Find $3^{205} \ (\bmod\ 101)$. By the Fermat little theorem, $3^{\phi(101)} \equiv 3^{100} \equiv 1 \ (\bmod\ 101)$. Therefore

$$3^{205} \equiv 3^{200}3^5 \equiv 3^5 \equiv 243 \equiv 38 \ (\bmod\ 101).$$

2. Find $5^{10000} \ (\bmod\ 18)$. Note that $\phi(18) = 6$. By Euler’s theorem, $5^6 \equiv 1 \ (\bmod\ 18)$. Therefore

$$5^{10000} \equiv 5^4 \equiv 25^2 \equiv 7^2 \equiv 13 \ (\bmod\ 18).$$
EX 1.64 a^p ≡ a (mod p) 증명 Proving a^p ≡ a (mod p)
한국어

$p$가 소수이고 $a$가 정수이면 $a^p \equiv a \ (\bmod\ p)$임을 증명하라.

$p \mid a$인 경우와 $p \nmid a$인 경우로 나눈다.

$p \mid a$이면 $a \equiv 0 \ (\bmod\ p)$이므로 $a^p \equiv 0 \equiv a \ (\bmod\ p)$이다.

$p \nmid a$이면 $\gcd(a, p) = 1$이므로 페르마 소정리(정리 1.62)에 의해 $a^{p-1} \equiv 1 \ (\bmod\ p)$이고, 양변에 $a$를 곱하면 $a^p \equiv a \ (\bmod\ p)$이다.

English

If $p$ is a prime and $a$ is an integer, then $a^p \equiv a \ (\bmod\ p)$.

We split into two cases according to whether $p \mid a$.

If $p \mid a$, then $a \equiv 0 \ (\bmod\ p)$, so $a^p \equiv 0 \equiv a \ (\bmod\ p)$.

If $p \nmid a$, then $\gcd(a, p) = 1$, so by the Fermat little theorem (Theorem 1.62), $a^{p-1} \equiv 1 \ (\bmod\ p)$; multiplying both sides by $a$ gives $a^p \equiv a \ (\bmod\ p)$.

EX 1.65 법 12의 원시근 All Primitive Roots of mod 12
한국어

법 12의 원시근을 모두 구하라.

$\phi(12) = 4$이다. 법 12에 대하여 가역인 원소는 $1, 5, 7, 11$이다(예제 1.31). 각각의 위수를 구하면

$$5^2 = 25 \equiv 1, \qquad 7^2 = 49 \equiv 1, \qquad 11^2 = 121 \equiv 1 \ (\bmod\ 12)$$

이므로 $5, 7, 11$의 위수는 모두 $2$이고, $1$의 위수는 $1$이다. 위수가 $\phi(12) = 4$인 원소가 없으므로 법 12의 원시근은 존재하지 않는다. (이는 정리 1.60과도 일치한다. $12 = 2^2 \times 3$은 소수 $p$와 양의 정수 $k$에 대하여 $2, 4, p^k, 2p^k$의 어느 꼴도 아니기 때문이다.)

English

Find all primitive roots of mod 12.

$\phi(12) = 4$. The invertible elements modulo 12 are $1, 5, 7, 11$ (Example 1.31). Computing their orders,

$$5^2 = 25 \equiv 1, \qquad 7^2 = 49 \equiv 1, \qquad 11^2 = 121 \equiv 1 \ (\bmod\ 12)$$

so $5, 7, 11$ all have order $2$, and $1$ has order $1$. No element has order $\phi(12) = 4$, so there is no primitive root of mod 12. (This agrees with Theorem 1.60: $12 = 2^2 \times 3$ is not of the form $2, 4, p^k$ or $2p^k$ for any prime $p$ and positive integer $k$.)

EX 1.66 법 10의 원시근 All Primitive Roots of mod 10
한국어

법 10의 원시근을 모두 구하라.

$\phi(10) = 4$이다. 법 10에 대하여 가역인 원소는 $1, 3, 7, 9$이다. 3의 거듭제곱을 계산하면

$$3^1 = 3, \quad 3^2 = 9, \quad 3^3 = 27 \equiv 7, \quad 3^4 = 81 \equiv 1 \ (\bmod\ 10)$$

이므로 3의 위수는 4이다. 7의 거듭제곱을 계산하면

$$7^1 = 7, \quad 7^2 = 49 \equiv 9, \quad 7^3 \equiv 63 \equiv 3, \quad 7^4 \equiv 21 \equiv 1 \ (\bmod\ 10)$$

이므로 7의 위수도 4이다. 한편 $9^2 = 81 \equiv 1 \ (\bmod\ 10)$이므로 9의 위수는 2이다. 위수가 $\phi(10) = 4$인 원소는 3과 7뿐이므로, 법 10의 원시근은 $\{3, 7\}$이다.

English

Find all primitive roots of mod 10.

$\phi(10) = 4$. The invertible elements modulo 10 are $1, 3, 7, 9$. Computing powers of 3,

$$3^1 = 3, \quad 3^2 = 9, \quad 3^3 = 27 \equiv 7, \quad 3^4 = 81 \equiv 1 \ (\bmod\ 10)$$

so 3 has order 4. Computing powers of 7,

$$7^1 = 7, \quad 7^2 = 49 \equiv 9, \quad 7^3 \equiv 63 \equiv 3, \quad 7^4 \equiv 21 \equiv 1 \ (\bmod\ 10)$$

so 7 also has order 4. Meanwhile $9^2 = 81 \equiv 1 \ (\bmod\ 10)$, so 9 has order 2. Only 3 and 7 have order $\phi(10) = 4$, so the primitive roots of mod 10 are $\{3, 7\}$.

EX 1.67 6^10004 (mod 11) 구하기 Finding 6^10004 (mod 11)
한국어

$6^{10004} \ (\bmod\ 11)$을 구하라.

$\gcd(6, 11) = 1$이므로 페르마 소정리에 의해 $6^{10} \equiv 1 \ (\bmod\ 11)$이다. $10004 = 10 \times 1000 + 4$이므로

$$6^{10004} \equiv (6^{10})^{1000} \times 6^4 \equiv 6^4 \ (\bmod\ 11).$$

$6^2 = 36 \equiv 3 \ (\bmod\ 11)$이므로 $6^4 = (6^2)^2 \equiv 3^2 = 9 \ (\bmod\ 11)$이다. 따라서

$$6^{10004} \equiv 9 \ (\bmod\ 11).$$
English

Find $6^{10004} \ (\bmod\ 11)$.

Since $\gcd(6, 11) = 1$, by the Fermat little theorem, $6^{10} \equiv 1 \ (\bmod\ 11)$. Since $10004 = 10 \times 1000 + 4$,

$$6^{10004} \equiv (6^{10})^{1000} \times 6^4 \equiv 6^4 \ (\bmod\ 11).$$

Since $6^2 = 36 \equiv 3 \ (\bmod\ 11)$, $6^4 = (6^2)^2 \equiv 3^2 = 9 \ (\bmod\ 11)$. Therefore

$$6^{10004} \equiv 9 \ (\bmod\ 11).$$
EX 1.68 2^10000 (mod 13) 구하기 Finding 2^10000 (mod 13)
한국어

$2^{10000} \ (\bmod\ 13)$을 구하라.

$\gcd(2, 13) = 1$이므로 페르마 소정리에 의해 $2^{12} \equiv 1 \ (\bmod\ 13)$이다. $10000 = 12 \times 833 + 4$이므로

$$2^{10000} \equiv (2^{12})^{833} \times 2^4 \equiv 2^4 = 16 \equiv 3 \ (\bmod\ 13).$$

따라서 $2^{10000} \equiv 3 \ (\bmod\ 13)$이다.

English

Find $2^{10000} \ (\bmod\ 13)$.

Since $\gcd(2, 13) = 1$, by the Fermat little theorem, $2^{12} \equiv 1 \ (\bmod\ 13)$. Since $10000 = 12 \times 833 + 4$,

$$2^{10000} \equiv (2^{12})^{833} \times 2^4 \equiv 2^4 = 16 \equiv 3 \ (\bmod\ 13).$$

So $2^{10000} \equiv 3 \ (\bmod\ 13)$.

EX 1.69 법 18에 대하여 가역인 a의 개수 Counting a Invertible of mod 18
한국어

$1 \le a \le 18$이고 법 18에 대하여 가역인 $a$의 개수를 구하라.

$18 = 2 \times 3^2$이므로 정리 1.48에 의해 $\phi(18) = \phi(2)\phi(3^2) = 1 \times 6 = 6$이다. REM 3에 의해 이는 법 18에 대하여 가역인 $a$ $(1 \le a \le 18)$의 개수와 같다. 실제로 가역인 원소는

$$1, 5, 7, 11, 13, 17$$

로(18과 서로소인, 즉 2의 배수도 3의 배수도 아닌 수들) 모두 $6$개이며, $\phi(18) = 6$과 일치한다.

English

Find the number of $a$ $(1 \le a \le 18)$ such that $a$ invertible of mod 18.

Since $18 = 2 \times 3^2$, by Theorem 1.48, $\phi(18) = \phi(2)\phi(3^2) = 1 \times 6 = 6$. By Remark 3, this equals the number of invertible $a$ $(1 \le a \le 18)$ modulo 18. Indeed, the invertible elements are

$$1, 5, 7, 11, 13, 17$$

(those relatively prime to 18, i.e. not multiples of 2 or 3), which are $6$ in total, matching $\phi(18) = 6$.