4. Number Theory and Crytography

Number theory is the part of mathematics devoted to the study of the integers and their properties.
💡 这些都是初中奥数的知识了,看看英文怎么表达基本上就能搞定。

4.1 Divisibility and Modular Arithmetic

4.1.1 Division

If 离散数学及其应用 第4章 数论与密码学 - 图1 and 离散数学及其应用 第4章 数论与密码学 - 图2 are integers with 离散数学及其应用 第4章 数论与密码学 - 图3, then 离散数学及其应用 第4章 数论与密码学 - 图4 **divides** 离散数学及其应用 第4章 数论与密码学 - 图5 if there exists an integer 离散数学及其应用 第4章 数论与密码学 - 图6 such that 离散数学及其应用 第4章 数论与密码学 - 图7, or equivalently 离散数学及其应用 第4章 数论与密码学 - 图8, denoted by 离散数学及其应用 第4章 数论与密码学 - 图9. When 离散数学及其应用 第4章 数论与密码学 - 图10 divides 离散数学及其应用 第4章 数论与密码学 - 图11, we say that 离散数学及其应用 第4章 数论与密码学 - 图12 is a **factor** or **divisor** of 离散数学及其应用 第4章 数论与密码学 - 图13 and that 离散数学及其应用 第4章 数论与密码学 - 图14 is a **multiple** of 离散数学及其应用 第4章 数论与密码学 - 图15. If 离散数学及其应用 第4章 数论与密码学 - 图16 does not divide 离散数学及其应用 第4章 数论与密码学 - 图17, we write 离散数学及其应用 第4章 数论与密码学 - 图18.
📋 Properties of Divisibility
Let 离散数学及其应用 第4章 数论与密码学 - 图19, 离散数学及其应用 第4章 数论与密码学 - 图20, and 离散数学及其应用 第4章 数论与密码学 - 图21 be integers, where 离散数学及其应用 第4章 数论与密码学 - 图22.

  • If 离散数学及其应用 第4章 数论与密码学 - 图23 and 离散数学及其应用 第4章 数论与密码学 - 图24, then 离散数学及其应用 第4章 数论与密码学 - 图25 whenever 离散数学及其应用 第4章 数论与密码学 - 图26;
  • If 离散数学及其应用 第4章 数论与密码学 - 图27, then 离散数学及其应用 第4章 数论与密码学 - 图28 for all integers 离散数学及其应用 第4章 数论与密码学 - 图29;
  • If 离散数学及其应用 第4章 数论与密码学 - 图30 and 离散数学及其应用 第4章 数论与密码学 - 图31, then 离散数学及其应用 第4章 数论与密码学 - 图32.

📋 Division Algorithm
If 离散数学及其应用 第4章 数论与密码学 - 图33 is an integer and 离散数学及其应用 第4章 数论与密码学 - 图34 a positive integer, then there are unique integers 离散数学及其应用 第4章 数论与密码学 - 图35 and 离散数学及其应用 第4章 数论与密码学 - 图36, with 离散数学及其应用 第4章 数论与密码学 - 图37, such that 离散数学及其应用 第4章 数论与密码学 - 图38. Here 离散数学及其应用 第4章 数论与密码学 - 图39 is called the **divisor**, 离散数学及其应用 第4章 数论与密码学 - 图40 is called the **dividend**, 离散数学及其应用 第4章 数论与密码学 - 图41 is called the **quotient**, 离散数学及其应用 第4章 数论与密码学 - 图42 is called the **remainder**. The notation is 离散数学及其应用 第4章 数论与密码学 - 图43 and 离散数学及其应用 第4章 数论与密码学 - 图44.
⚠️ Note that the remainder cannot be negative. 离散数学及其应用 第4章 数论与密码学 - 图45, 离散数学及其应用 第4章 数论与密码学 - 图46.+

4.1.2 Congruence

**Congruence Relation** If 离散数学及其应用 第4章 数论与密码学 - 图47 and 离散数学及其应用 第4章 数论与密码学 - 图48 are integers and 离散数学及其应用 第4章 数论与密码学 - 图49 is a positive integer, then 离散数学及其应用 第4章 数论与密码学 - 图50 is congruent to 离散数学及其应用 第4章 数论与密码学 - 图51 modulo 离散数学及其应用 第4章 数论与密码学 - 图52 if 离散数学及其应用 第4章 数论与密码学 - 图53, denoted by 离散数学及其应用 第4章 数论与密码学 - 图54. We say that 离散数学及其应用 第4章 数论与密码学 - 图55 is a **congruence** and that 离散数学及其应用 第4章 数论与密码学 - 图56 is its **modulus**. If 离散数学及其应用 第4章 数论与密码学 - 图57 is not congruent to 离散数学及其应用 第4章 数论与密码学 - 图58 modulo 离散数学及其应用 第4章 数论与密码学 - 图59, we write 离散数学及其应用 第4章 数论与密码学 - 图60.
📋 Two integers are congruent mod 离散数学及其应用 第4章 数论与密码学 - 图61 if and only if they have the same remainder when divided by 离散数学及其应用 第4章 数论与密码学 - 图62, or equivalently there is an integer 离散数学及其应用 第4章 数论与密码学 - 图63 such that 离散数学及其应用 第4章 数论与密码学 - 图64.
📋 Let 离散数学及其应用 第4章 数论与密码学 - 图65 and 离散数学及其应用 第4章 数论与密码学 - 图66 be integers, and let 离散数学及其应用 第4章 数论与密码学 - 图67 be a positive integer. Then 离散数学及其应用 第4章 数论与密码学 - 图68.
⚠️ The use of “mod” in 离散数学及其应用 第4章 数论与密码学 - 图69 and 离散数学及其应用 第4章 数论与密码学 - 图70_ _are different. 离散数学及其应用 第4章 数论与密码学 - 图71 is a relation on the set of integers, while in 离散数学及其应用 第4章 数论与密码学 - 图72, the notation 离散数学及其应用 第4章 数论与密码学 - 图73 denotes a function.
📋 Congruences of Sums and Products
Let 离散数学及其应用 第4章 数论与密码学 - 图74 be a positive integer.
If 离散数学及其应用 第4章 数论与密码学 - 图75 and 离散数学及其应用 第4章 数论与密码学 - 图76,
then 离散数学及其应用 第4章 数论与密码学 - 图77 and 离散数学及其应用 第4章 数论与密码学 - 图78.
Corollary: Let 离散数学及其应用 第4章 数论与密码学 - 图79 be a positive integer and let 离散数学及其应用 第4章 数论与密码学 - 图80 and 离散数学及其应用 第4章 数论与密码学 - 图81 be integers, then
离散数学及其应用 第4章 数论与密码学 - 图82
离散数学及其应用 第4章 数论与密码学 - 图83
📋 Algebraic Manipulation of Congruences

  • Multiplying both sides of a valid congruence by an integer preserves validity.
    • If 离散数学及其应用 第4章 数论与密码学 - 图84 holds, then 离散数学及其应用 第4章 数论与密码学 - 图85, where 离散数学及其应用 第4章 数论与密码学 - 图86 is any integer, holds by the theorem of congruences of products with 离散数学及其应用 第4章 数论与密码学 - 图87.
  • Adding an integer to both sides of a valid congruence preserves validity.

    • If 离散数学及其应用 第4章 数论与密码学 - 图88 holds then 离散数学及其应用 第4章 数论与密码学 - 图89, where 离散数学及其应用 第4章 数论与密码学 - 图90 is any integer, holds by the theorem of congruences of sums with 离散数学及其应用 第4章 数论与密码学 - 图91.

      4.1.3 Arithmetic Modulo

      The operation 离散数学及其应用 第4章 数论与密码学 - 图92 is defined as 离散数学及其应用 第4章 数论与密码学 - 图93. This is **addition modulo m**.
      The operation 离散数学及其应用 第4章 数论与密码学 - 图94 is defined as 离散数学及其应用 第4章 数论与密码学 - 图95. This is **multiplication modulo m**.
      Using these operations is said to be doing **arithmetic modulo m**.
      Let 离散数学及其应用 第4章 数论与密码学 - 图96 be the set of nonnegative integers less than 离散数学及其应用 第4章 数论与密码学 - 图97. That is 离散数学及其应用 第4章 数论与密码学 - 图98.
      🌰 e.g.
      7 +11 9 = (7 + 9) mod 11 = 5
      9 ·11 7 = (9 · 7) mod 11 = 8
      📋 The operations 离散数学及其应用 第4章 数论与密码学 - 图99 and 离散数学及其应用 第4章 数论与密码学 - 图100 satisfy many of the same properties as ordinary addition and multiplication.
  • Closure: 离散数学及其应用 第4章 数论与密码学 - 图101

  • Associativity: 离散数学及其应用 第4章 数论与密码学 - 图102
  • Commutativity: 离散数学及其应用 第4章 数论与密码学 - 图103
  • Identity elements: The elements 0 and 1 are identity elements for addition and multiplication modulo 离散数学及其应用 第4章 数论与密码学 - 图104, respectively. If 离散数学及其应用 第4章 数论与密码学 - 图105 belongs to 离散数学及其应用 第4章 数论与密码学 - 图106 , then 离散数学及其应用 第4章 数论与密码学 - 图107 and 离散数学及其应用 第4章 数论与密码学 - 图108.
  • Additive inverses: If 离散数学及其应用 第4章 数论与密码学 - 图109 belongs to 离散数学及其应用 第4章 数论与密码学 - 图110, then 离散数学及其应用 第4章 数论与密码学 - 图111(⚠️ not 离散数学及其应用 第4章 数论与密码学 - 图112 because it is not in 离散数学及其应用 第4章 数论与密码学 - 图113) is the additive inverse of a modulo 离散数学及其应用 第4章 数论与密码学 - 图114 and 0 is its own additive inverse. 离散数学及其应用 第4章 数论与密码学 - 图115 and 离散数学及其应用 第4章 数论与密码学 - 图116.
  • Distributivity: If 离散数学及其应用 第4章 数论与密码学 - 图117, then 离散数学及其应用 第4章 数论与密码学 - 图118 and 离散数学及其应用 第4章 数论与密码学 - 图119

⚠️ Multiplicatative inverses have not been included since they do not always exist. For example, there is no multiplicative inverse of 2 modulo 6.

4.2 节没什么知识,跳过了。

4.3 Primes and GCDs

4.3.1 Primes

A positive integer 离散数学及其应用 第4章 数论与密码学 - 图120 greater than 1 is called **prime** if the only positive factors of 离散数学及其应用 第4章 数论与密码学 - 图121 are 1 and 离散数学及其应用 第4章 数论与密码学 - 图122. A positive integer that is greater than 1 and is not prime is called **composite**.
📋 The Foundamental Theorm of Arithmetic
Every positive integer greater than 1 can be written uniquely as a prime or as the product of two or more primes where the prime factors are written in order of nondecreasing size.
📋 Trial division
Trial division, a very inefficient method of determining if a number n is prime, is to try every integer 离散数学及其应用 第4章 数论与密码学 - 图123 and see if 离散数学及其应用 第4章 数论与密码学 - 图124 is divisible by 离散数学及其应用 第4章 数论与密码学 - 图125. This is because if an integer 离散数学及其应用 第4章 数论与密码学 - 图126 is a composite integer, then it has a prime divisor less than or equal to 离散数学及其应用 第4章 数论与密码学 - 图127. To see this, note that if 离散数学及其应用 第4章 数论与密码学 - 图128, then 离散数学及其应用 第4章 数论与密码学 - 图129 or 离散数学及其应用 第4章 数论与密码学 - 图130.
📋 Infinitude of Primes (proof by Eucluid)
There are infinitely many primes.
Proof:
Assume finitely many primes: 离散数学及其应用 第4章 数论与密码学 - 图131.
Let 离散数学及其应用 第4章 数论与密码学 - 图132_, _then 离散数学及其应用 第4章 数论与密码学 - 图133 is a prime not in the list of all the primes.
So there are infinitely many primes.

4.3.2 GCD and LCM

Let 离散数学及其应用 第4章 数论与密码学 - 图134 and 离散数学及其应用 第4章 数论与密码学 - 图135 be integers, not both zero. The largest integer 离散数学及其应用 第4章 数论与密码学 - 图136 such that 离散数学及其应用 第4章 数论与密码学 - 图137 and also 离散数学及其应用 第4章 数论与密码学 - 图138 is called the **greatest common divisor (GCD)** of 离散数学及其应用 第4章 数论与密码学 - 图139 and 离散数学及其应用 第4章 数论与密码学 - 图140. The greatest common divisor of 离散数学及其应用 第4章 数论与密码学 - 图141 and 离散数学及其应用 第4章 数论与密码学 - 图142 is denoted by 离散数学及其应用 第4章 数论与密码学 - 图143.
The **least common multiple (LCM)** of the positive integers 离散数学及其应用 第4章 数论与密码学 - 图144 and 离散数学及其应用 第4章 数论与密码学 - 图145 is the smallest positive integer that is divisible by both 离散数学及其应用 第4章 数论与密码学 - 图146 and 离散数学及其应用 第4章 数论与密码学 - 图147. It is denoted by 离散数学及其应用 第4章 数论与密码学 - 图148.
The integers 离散数学及其应用 第4章 数论与密码学 - 图149 and 离散数学及其应用 第4章 数论与密码学 - 图150 are **relatively prime** if their greatest common divisor is 1. The integers 离散数学及其应用 第4章 数论与密码学 - 图151 are **pairwise relatively prime** if 离散数学及其应用 第4章 数论与密码学 - 图152 whenever 离散数学及其应用 第4章 数论与密码学 - 图153.
📋 Finding GCDs and LCMs Using Prime Factorizations
Suppose the prime factorizations of 离散数学及其应用 第4章 数论与密码学 - 图154 and 离散数学及其应用 第4章 数论与密码学 - 图155 are:
image.pngimage.png
where each exponent is a nonnegative integer, and where all primes occurring in either prime factorization are included in both. Then:
image.png
image.png
📋 Let 离散数学及其应用 第4章 数论与密码学 - 图160 and 离散数学及其应用 第4章 数论与密码学 - 图161 be positive integers. Then 离散数学及其应用 第4章 数论与密码学 - 图162.
📋 Euclidean Algorithm(辗转相除法)
The Euclidian algorithm is an efficient method for computing the greatest common divisor of two integers. It is based on the idea that 离散数学及其应用 第4章 数论与密码学 - 图163 is equal to 离散数学及其应用 第4章 数论与密码学 - 图164 when 离散数学及其应用 第4章 数论与密码学 - 图165 and 离散数学及其应用 第4章 数论与密码学 - 图166 is the remainder when 离散数学及其应用 第4章 数论与密码学 - 图167 is divided by 离散数学及其应用 第4章 数论与密码学 - 图168.
The Euclidean algorithm expressed in pseudocode is:
image.png
📋 Bézout’s Theorem(裴蜀定理)
If 离散数学及其应用 第4章 数论与密码学 - 图170 and 离散数学及其应用 第4章 数论与密码学 - 图171 are positive integers, then there exist integers 离散数学及其应用 第4章 数论与密码学 - 图172 and 离散数学及其应用 第4章 数论与密码学 - 图173 such that 离散数学及其应用 第4章 数论与密码学 - 图174. Integers 离散数学及其应用 第4章 数论与密码学 - 图175 and 离散数学及其应用 第4章 数论与密码学 - 图176 such that 离散数学及其应用 第4章 数论与密码学 - 图177 are called **Bézout coefficients** of 离散数学及其应用 第4章 数论与密码学 - 图178 and 离散数学及其应用 第4章 数论与密码学 - 图179. The equation 离散数学及其应用 第4章 数论与密码学 - 图180 is called **Bézout's identity**(裴蜀恒等式). To find Bézout coefficients, first use the Euclidian algorithm to find the gcd, and then works backwards to express the gcd as a linear combination of the original two integers.

🌰 e.g.
Express 离散数学及其应用 第4章 数论与密码学 - 图181 as a linear combination of 252 and 198.
image.png
📋 If 离散数学及其应用 第4章 数论与密码学 - 图183, 离散数学及其应用 第4章 数论与密码学 - 图184, and 离散数学及其应用 第4章 数论与密码学 - 图185 are positive integers such that 离散数学及其应用 第4章 数论与密码学 - 图186 and 离散数学及其应用 第4章 数论与密码学 - 图187, then 离散数学及其应用 第4章 数论与密码学 - 图188.
Proof:
Since 离散数学及其应用 第4章 数论与密码学 - 图189, by Bézout’s Theorem there are integers 离散数学及其应用 第4章 数论与密码学 - 图190 and 离散数学及其应用 第4章 数论与密码学 - 图191 such that 离散数学及其应用 第4章 数论与密码学 - 图192. Multiplying both sides of the equation by 离散数学及其应用 第4章 数论与密码学 - 图193, yields 离散数学及其应用 第4章 数论与密码学 - 图194.
Since 离散数学及其应用 第4章 数论与密码学 - 图195 and 离散数学及其应用 第4章 数论与密码学 - 图196, we can conclude that 离散数学及其应用 第4章 数论与密码学 - 图197.
📋If p is prime and p | a1a2…a__n, then p | a__i for some i.
(Proof uses mathematical induction. It is crucial in the proof of the uniqueness of prime factorizations.)
📋A prime factorization of a positive integer where the primes are in nondecreasing order is unique.
image.png
📋Let m be a positive integer and let a, b, and c be integers. If ac ≡ bc (mod m) and gcd(c, m) = 1, then a ≡ b (mod m).
Proof: Since ac ≡ bc (mod m), m | ac − bc = c(a − b) and the fact that gcd(c, m) = 1, it follows that m | a−b. Hence, a ≡ b (mod m).

4.4 Solving Congruences

4.4.1 Linear Congruences

A congruence of the form ax ≡ b (mod m), where m is a positive integer, a and b are integers, and x is a variable, is called a **linear congruence**. The solutions to a linear congruence ax ≡ b(mod m) are all integers x that satisfy the congruence.
An integer ā such that āa ≡ 1(mod m) is said to be an **inverse** of a modulo m.
The Euclidean algorithm and Bézout coefficients gives us a systematic approaches to finding inverses.
📋If a and m are relatively prime integers and m > 1, then an inverse of a modulo m exists. Furthermore, this inverse is unique modulo m. (This means that there is a unique positive integer ā less than m that is an inverse of a modulo m and every other inverse of a modulo m is congruent to ā modulo m.)
Proof:
Since gcd(a, m) = 1, there exist integers s and t such that sa + tm = 1. Hence, sa + tm ≡ 1(mod m). Since tm ≡ 0(mod m), it follows that sa ≡ 1(mod m). Consequently, s is an inverse of a modulo m.
📋Finding Inverses
The Euclidean algorithm and Bézout coefficients gives us a systematic approaches to finding inverses.
🌰e.g.
Find an inverse of 3 modulo 7.
Solution:
3 and 7 are relatively prime, so there exist an inverse of 3 modulo 7. Using the Euclidian algorithm: 7 = 2 × 3 + 1, so -2 and 7 are Bézout coefficients of 3 and 7.
-2 × 3 + 1 × 7 = 1, and -2 × 3 + 1 × 7 ≡ -2 × 3 (mod 7), so -2 is an inverse of 3 modulo 7. And every integer congruent to -2 modulo 7 is an inverse of 3 modulo 7.
📋Solving Congruences Using Inverses
We can solve the congruence ax ≡ b(mod m) by multiplying both sides by ā.
🌰e.g.
What are the solutions of the congruence 3x ≡ 4(mod 7) ?
Solution:
-2 is an inverse of 3 modulo 7, so multiply both sides of the congruence by -2 giving -2 × 3x ≡ -2 × 4(mod 7). _Because −6 ≡ 1 (mod 7) and −8 ≡ 6 (mod 7), it follows that if _x is a solution, then x ≡ −8 ≡ 6 (mod 7).
We need to determine if every x with x ≡ 6 (mod 7) is a solution. Multiply both sides by 3 and get 3x ≡ 18 ≡ 4(mod 7), _which shows that all such _x satisfy the congruence.
📋Solving Systems of Linear Congruences Using Back Substitution
Substitute the value for the variable into another congruence, and continuing the process until we have worked through all the congruences.
🌰e.g.
Use the method of back substitution to find all integers x such that x ≡ 1 (mod 5), x ≡ 2 (mod 6), and x ≡ 3 (mod 7).
Solution:
The first congruence can be rewritten as x = 5t +1, t ∈ ℤ.
Substituting into the second congruence yields 5t +1 ≡ 2 (mod 6). Solving this tells us that t ≡ 5 (mod 6). So t = 6u + 5, u ∈ ℤ. Substituting this back into x = 5t +1, gives x = 5(6u + 5) +1 = 30u + 26.
Inserting this into the third equation gives 30u + 26 ≡ 3 (mod 7). Solving this congruence tells us that u ≡ 6 (mod 7). So u = 7v + 6, v ∈ ℤ. Substituting this expression for u into x = 30u + 26, tells us that x = 30(7v + 6) + 26 = 210u + 206.
Translating this back into a congruence we find the solution x ≡ 206 (mod 210).

4.4.2 The Chinese Remainder Theorem

It is a different method to solve a system of linear congruences.
📋The Chinese Remainder Theorem
Let m1, m2, … , m__n be pairwise relatively prime positive integers greater than 1 and a1, a2, … , a__n arbitrary integers. Then the system:
image.png
has a unique solution modulo m = m1 × m2 × … × m__n. (That is, there is a solution x with 0 ≤ x < m and all other solutions are congruent modulo m to this solution.)
Proof:
It is a constructive proof.
First let Mk = m/m__k for k = 1, 2, … , n. Since gcd(mk, Mk) = 1, there is an integer y__k, an inverse of M__k modulo m__k, such that Mkyk ≡ 1 (mod mk). Form the sum x = a1M1y1 + a2M2y2 + … + anMny__n. Note that because Mj ≡ 0 (mod mk) whenever j ≠ k, all terms except the k-th term in this sum are congruent to 0 modulo m__k. Because Mkyk ≡ 1(mod mk), we see that x ≡ akMkyk ≡ ak(mod mk), for k = 1, 2, … , n. Hence, x is a simultaneous solution to the n congruences.

🌰e.g.
有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二。问物几何?(《孙子算经》)
Solution:
x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7).
m = 3×5×7 = 105, M1 = m/3 = 35, M2 = m/5 = 21, M3 = m/7 = 15.
2 is an inverse of M1 modulo 3, 1 is an inverse of M2 modulo 5, 1 is an inverse of M3 modulo 7.
Hence, x = a1M1y1 + a2M2y2 + a3M3y3 = 2×_35×2 + 3×21×1 + 2×15×_1 = 233 ≡ 23 (mod 105). So 23 is the smallest positive integer that is a simultaneous solution.
⚙️It is important to solve systems of linear congruences. Computers sometime store big integers in the form of theirs remainders and moduli.

4.4.3 Fermat’s Little Theorem

📋Fermat’s Little Theorem
If p is prime and a is an integer not divisible by p, then ap-1 ≡ 1 (mod p). Furthermore, for every integer a, no matter if it is divisible by p, we have ap ≡ a (mod p).
Proof:

⚙️Fermat’s little theorem is useful in computing the remainders modulo p of large powers of integers.
🌰e.g.
Find 7222 mod 11.
Solution:
By Fermat’s little theorem, we know that 710 ≡ 1 (mod 11), and so (710)k ≡1 (mod 11), for every positive integer k. Therefore, 7222 = 722∙10 + 2 = (710)22×72 ≡ (1)22×49 ≡ 5 (mod 11). Hence, 7222 mod 11 = 5.
A number p not satisfying Fermat’s Little Theorem must be a composite, but not every p satisfying Fermat’s Little Theorem is a prime. Let b be a positive integer. If n is a composite integer, and bn-1 ≡ 1 (mod n), then n is called a **pseudoprime** to the **base** b. Among the positive integers not exceeding a positive real number x, compared to primes, there are relatively few pseudoprimes to the base b.
🌰e.g.
Show that 341 is a pseudoprime to the base 2.
Proof:
341 = 11 ∙ 31, so 341 is a composite. 2340 ≡ 1 (mod 341), so it is a pseudoprime.
We can replace 2 by any integer b ≥ 2 as well.
There are composite integers n that pass all tests with bases b such that gcd(b, n) = 1. A composite integer n that satisfies the congruence bn-1 ≡ 1 (mod n) for all positive integers b with gcd(b, n) = 1 is called a **Carmichael number**.
🌰e.g.
Show that 561 is a Carmichael number.
Proof:
561 is composite, since 561 = 3 ∙ 11 ∙ 13.
If gcd(b, 561) = 1, then gcd(b, 3) = gcd(b, 11) = gcd(b, 17) = 1.
Using Fermat’s Little Theorem: b2 ≡ 1 (mod 3), b10 ≡ 1 (mod 11), b16 ≡ 1 (mod17).
Then
image.png
It follows that b560 ≡ 1 (mod 561) for all positive integers b with gcd(b,561) = 1. Hence, 561 is a Carmichael number.