本文是美国伊利诺伊大学香槟分校(University of Illinois at Urbana-Champaign)的Bruce Berndt教授的数论课程的学习笔记。

《Elementary Number Theory》

Week 1

1. 概念

agreed-upon notations:

  • ∃: “there exists”
  • ∀: “for every”
  • ∈: “member of”
  • ⊆, ⊇: subset, superset
  • [x] = greatest integer ≤ x: https://zh.wikipedia.org/wiki/%E5%8F%96%E6%95%B4%E5%87%BD%E6%95%B0

素数 prime: >=2

孪生素数 twin primes:If p and p + 2 are primes,∃无穷对

https://zh.wikipedia.org/wiki/%E5%AD%AA%E7%94%9F%E7%B4%A0%E6%95%B0

梅森素数 Mersenne prime: p is a prime and 2^p - 1 is a prime

π(x) = # of primes ≤ x,#表数量,=li x+△(x) (△(x)=O(√x (log(x))^2)为误差项error term)

li x= ∫_2^x dt/log(t) ∼ x/log(x)

渐进 f (x) is asymptotic to g(x) as x → ∞:lim f (x)/g(x) = 1 (x→∞)

Big-O:f (x) = O(g(x)) as x → ∞ if ∃C > 0 ∋ ∣f (x)∣ ≤ C ∣g(x)∣ for x suffciently large.

素数定理 Prime Number Theorem:As x → ∞, π(x) ∼ x/logx

https://zh.wikipedia.org/wiki/%E8%B3%AA%E6%95%B8%E5%AE%9A%E7%90%86

黎曼猜想 Riemann Hypothesis:All non-trivial zeroes of ζ(z) are on Re z = 1/2

https://zh.wikipedia.org/wiki/%E9%BB%8E%E6%9B%BC%E7%8C%9C%E6%83%B3

黎曼ζ函数 Riemann Zeta Function ζ(z)=∑1/n^x converges for x > 1,∑1/n^z  converges for Re z > 1,均是n=1到∞,it has an analytic continuation to the entire complex plane.

https://zh.wikipedia.org/wiki/%E9%BB%8E%E6%9B%BC%CE%B6%E5%87%BD%E6%95%B8

a ≡ b mod c:c ∣ (a - b)

r2(n) = # of representations of n as a sum of two squares, π(√x - 1)2 ≤ ∑n≤x r2(n) ≤ π(√x + 1)2

lattice point

分割函数 Partition P(n) = number of ways of writing n ∈ Z+ as a sum of positive integers.
Famous conjectures by Ramanujan:

  • P(5n + 4) ≡ O mod 5
  • P(7n + 5) ≡ O mod 7
  • P(11n + 6) ≡ O mod 11

辗转相除法/带余除法 Division Algorithm: Let a, b ∈ Z, b > 0. Then, ∃ unique q, r ∈ Z ∋ a = b q + r and 0 ≤ r < b.

爱拉托逊斯筛法 Sieve of Eratosthenes: want all primes ≤ x. List all integers up to x. Strike out every integer ≤ √x that’s a multiple of primes ≤ √x. (Because of the proposition: If n is composite, then ∃ at least one prime p ≤ √n dividing n.) Test primes p ∋ p ≤ √n. If none divide n, then n is prime.

最大公约数 Greatest Common Divisor(a, 0) = a, (a, 1) = 1, Let a, b ∈ Z, not both 0. Then, (a, b) = min{ma + nb > 0 ∶ m, n ∈ Z} > 0
最小公倍数 Least Common Multiple: [a,b], (a,b) [a,b] = ab

欧几里得算法 Euclidean Algorithm: Let a, b ∈ Z+, a ≥ b. Let a = b q + r, q, r ∈ Z. Then (a, b) = (b, r). Continue this process.

2. 小结论

A factorization:

3. 证明题

For n ∈ Z+, ∃ n consecutive composite numbers. Proof: (n + 1)! + 2, (n + 1)! + 3, . . . , (n + 1)! + (n + 1)

4.python代码

(1).基础数论运算:

math --- 数学函数 — Python 3.9.7 文档

包括gcd()、lcm():

import math
print(math.gcd(408,765))pow(7, 1987)%11

(2).判断素数

def isPrime(n):    if n <= 1:    return False   i = 2   while i*i <= n:    if n % i == 0:    return False   i += 1   return True

(3).因式分解

import time# 对一个数进行因式分解
def factorization(num):factor = []while num > 1:for i in range(num - 1):k = i + 2if num % k == 0:factor.append(k)num = int(num / k)breakreturn factor

(4).两个正整数a,b的gcd=ax+by的表达式系数:

# gcd_integer_solution
def gcd_integer_solution(p, q):"""求一个形如px+qy=gcd(p,q)(p、q均为正整数)方程的整数解的函数。Inputs:p, q: 方程左边的系数Outputs:x, y: 与p, q对应的未知数的解"""# 递归终止条件: q等于0时if q == 0:return 1, 0  # 返回(1,0)——当方程右侧是gcd(p,q)时,最后的解肯定是(1,0)# 递归的过程:调用函数取出(n+1)轮的解(x,y),利用递推公式计算n轮的解(x,y)并return它### 递归式子之前的过程是“向下递归”,之后的过程是“向上递归”else:x, y = gcd_integer_solution(q, p%q)  # (p,q)-->(q,p%q)的递归过程x, y = y, x - (p//q)*y  # 将(n+1)轮的解转换为n轮# a = y  # 将(n+1)轮的解转换为n轮,引入a是避免交叉赋值出错# y = x - (p//q)*a# x = areturn x, y

(5).求一个形如px+qy=c(p、q均为正整数,c为整数)方程的整数解的函数:

# integer_solution
import mathdef integer_solution(p, q, c):"""求一个形如px+qy=c(p、q均为正整数,c为整数)方程的整数解的函数。Inputs:p, q: 方程左边的系数,输入正整数c: 方程右边的系数Outputs:x, y: 方程的解"""gcd_p_q = math.gcd(p, q)# 只有在方程有解时才求解if c%gcd_p_q == 0:# 首先求解px+qy=gcd(p,q)x_gcd, y_gcd = gcd_integer_solution(p, q)# 然后转换为px+qy=c=gcd(p,q)*(c/gcd(p,q))的解x, y = x_gcd*(c/gcd_p_q), y_gcd*(c/gcd_p_q)    return x, y# 方程无解时返回两个Noneelse:return None, None

(6).其他

/*Algorithm: 快速幂/Fermat, Solovay_Stassen, Miller-Rabin素性检验
*/
import randomdef QuickPower(a, n, p): # 快速幂算法tmp = aret = 1while(n > 0):if (n&1):ret = (ret * tmp) % ptmp = (tmp * tmp) % pn>>=1return retdef Jacobi(n, m): # calc Jacobi(n/m)n = n%mif n == 0:return 0Jacobi2 = 1if not (n&1): # 若有n为偶数, 计算Jacobi2 = Jacobi(2/m)^(s) 其中n = 2^s*t t为奇数k = (-1)**(((m**2-1)//8)&1)while not (n&1):Jacobi2 *= kn >>= 1if n == 1:return Jacobi2return Jacobi2 * (-1)**(((m-1)//2*(n-1)//2)&1) * Jacobi(m%n, n)def Fermat(x, T): # Fermat素性判定if x < 2:return Falseif x <= 3:return Trueif x%2 == 0 or x%3 == 0:return Falsefor i in range(T):ran = random.randint(2, x-2) # 随机取[2, x-2]的一个整数if QuickPower(ran, x-1, x) != 1:return Falsereturn Truedef Solovay_Stassen(x, T): # Solovay_Stassen素性判定if x < 2:return Falseif x <= 3:return Trueif x%2 == 0 or x%3 == 0:return Falsefor i in range(T): # 随机选择T个整数ran = random.randint(2, x-2)r = QuickPower(ran, (x-1)//2, x)if r != 1 and r != x-1:return Falseif r == x-1:r = -1if r != Jacobi(ran, x):return Falsereturn Truedef MillerRabin(x, ran): # x-1 = 2^s*ttx = x-1s2 = tx&(~tx+1) # 取出最后一位以1开头的二进制 即2^sr = QuickPower(ran, tx//s2, x)if r == 1 or r == tx:return Truewhile s2>1: # 从2^s -> 2^1 循环s次r = (r*r)%xif r == 1:return Falseif r == tx:return Trues2 >>= 1return Falsedef MillerRabin_init(x, T): #Miller-Rabin素性判定if x < 2:return Falseif x <= 3:return Trueif x%2 == 0 or x%3 == 0:return Falsefor i in range(T): # 随机选择T个整数ran = random.randint(2, x-2)if not MillerRabin(x, ran):return Falsereturn True

Week 2

1. 概念

Frequency of Prime Numbers:


 

算术基本定理 Fundamental Theorem of Arithmetic: Every integer a > 1 can be represented uniquely as a product of primes

狄利克雷定理 Dirichlet’s Theorem on Primes in Arithmetic Progressions: If (a, b) = 1, then {an + b ∶ n ≥ 0} has infinitely-many primes.

同余 congruent a ≡ b (mod m): a is congruent to b modulo m, m ∈ Z+, if m ∣ (a - b).

https://zh.wikipedia.org/wiki/%E5%90%8C%E9%A4%98

Congruence defines Equivalence Relation.

Arithmetic Properties of the Congruence Relation:
a ≡ b (mod m) , c ≡ d (mod m), then:

  • a + c ≡ b + d (mod m)
  • ac ≡ bd (mod m)

ca ≡ cb (mod m) ⇐⇒ a ≡ b (mod m/(c,m))

等价类 Equivalence Classes

完全剩余系 Complete Residue System: Complete Residue System modulo m is a set, S, of integers such that every n ∈ Z is congruent to one and only one member of S. 是一个由n个数组成的集合

既约剩余系/简化剩余系/缩系 Reduced Residue System: A reduced residue system modulo m is a set of integers r_1, ...,r_n such that if (a,m) = 1, then a ≡ r_j( mod m) for 1 and only 1 value of j, m的完全剩余系中与m互素的数构成的子集

Theorem on a Complete (Reduced) System: Let r_1, ..,r_n be a complete (reduced) system modulo m. Let (a,m) = 1. Then a·r_1, ...,a·r_n is a a complete (reduced) residue system modulo m

恰整除 exactly divide p^a||n: p^a|n and p^(a+1)∤n

2. 小结论

If p|n!, the exponent of p in the prime factorization of n! is [n/p] + [n/p^2] + [n/p^3] + ...

3. 证明题

Let n ∈ Z with n > 1. Prove that 1 + 1/2 + 1/3 + · · · + 1/n ∉ Z

4.python代码

Week 3

1. 概念

乘法逆元素 Multiplicative Inverse: A solution of ax ≡ 1( mod m) is a (multiplicative) inverse of a mod m). The linear congruence ax ≡ 1( mod m) has a solution (inverse) if (a, m) = 1 and the inverse is unique.

https://zh.wikipedia.org/wiki/%E6%A8%A1%E5%8F%8D%E5%85%83%E7%B4%A0

中国剩余定理 Chinese Remainder Thm

https://zh.wikipedia.org/wiki/%E4%B8%AD%E5%9B%BD%E5%89%A9%E4%BD%99%E5%AE%9A%E7%90%86

威尔逊定理 Wilson’s Theorem: p is prime ⇐⇒ (p - 1)! ≡ -1 (mod p) (p>1)

https://zh.wikipedia.org/wiki/%E5%A8%81%E5%B0%94%E9%80%8A%E5%AE%9A%E7%90%86
Let p be a prime, then the inverse of a modulo p is a ⇐⇒ a ≡ ±1 (mod p)

威尔逊质数 Wilson prime p: (p - 1)! ≡ -1 (mod p^2)

2. 小结论

求解ax ≡ b (mod m)

Let ax ≡ b (mod m). Let d = (a, m). If d ∤ b, then there are no solutions. If d ∣ b, then there exist exactly d incongruent solutions modulo m. Example:
481x ≡ 629( mod 703)
d=(481, 703) = 37,
37 ∣ 629, ∃37 solutions
629 = 37 ⋅ 17 = 3 ⋅ 17 ⋅ 481 - 2 ⋅ 17 ⋅ 703
x0=51, 703/37=19
∴ x=51+19n, n = 0, 1, ..., 36

3.证明题

If p ≡ 1 mod 4, we’ll show that p = a^2 + b^2.

4.python代码

(1).求模逆元

def     gcd(a,b):while a!=0:a,b = b%a,areturn b
#定义一个函数,参数分别为a,n,返回值为b
def     findModReverse(a,m):#这个扩展欧几里得算法求模逆if gcd(a,m)!=1:return Noneu1,u2,u3 = 1,0,av1,v2,v3 = 0,1,mwhile v3!=0:q = u3//v3v1,v2,v3,u1,u2,u3 = (u1-q*v1),(u2-q*v2),(u3-q*v3),v1,v2,v3return u1%m#方法二:用定义求,但是效率很低
def findModReverse2(a,m):import itertoolsfor b in itertools.count(1):if (a*b)%m==1:return b

(2).中国剩余定理(Chinese Remainder Theorem, CRT)

仅适用于互质情况

#!/usr/bin/env python
from functools import reducedef egcd(a, b):"""扩展欧几里得"""if 0 == b:return 1, 0, ax, y, q = egcd(b, a % b)x, y = y, (x - a // b * y)return x, y, q
def chinese_remainder(pairs):"""中国剩余定理"""mod_list, remainder_list = [p[0] for p in pairs], [p[1] for p in pairs]mod_product = reduce(lambda x, y: x * y, mod_list)mi_list = [mod_product//x for x in mod_list]mi_inverse = [egcd(mi_list[i], mod_list[i])[0] for i in range(len(mi_list))]x = 0for i in range(len(remainder_list)):x += mi_list[i] * mi_inverse[i] * remainder_list[i]x %= mod_productreturn x
print(chinese_remainder([(3, 2), (5, 3), (7, 2)]))

Week 4

1. 概念

费马小定理 Fermat’s Little Theorem: If p is a prime and p ∤ a, then a^(p-1) ≡ 1 (mod p)

费马数 Fermat number F_n: =2^(2^n)+1

https://zh.wikipedia.org/wiki/%E8%B2%BB%E9%A6%AC%E6%95%B8

伪素数 pseudoprime n: 2^n ≡ 2(mod n)

Euler’s Φ-function Φ(n) = ∣{j ∈ Z, 1 ≤ j ≤ n, (j, n) = 1}∣

欧拉定理 Euler’s Theorem: Let {a, m} ∈ Z, m > 0, (a, m) = 1. Then a^Φ(m) ≡ 1(mod m)

https://zh.wikipedia.org/wiki/%E6%AC%A7%E6%8B%89%E5%AE%9A%E7%90%86_(%E6%95%B0%E8%AE%BA)

a^(Φ(m)-1) is the inverse of a(mod m)

Φ(p^a)=p^a-p^(a-1)

算术函数 Arithmetic functions a(n): are functions whose domains are the positive integers.
d(n) = # of divisors of n.
σ_a (n) = sum of the a^th powers of the divisors of n.
r_k (n) = # of representations of n as a sum of k squares.

积性函数 multiplicative a(n): if whenever (m, n) = 1, then a(mn) = a(m) a(n)

https://zh.wikipedia.org/wiki/%E7%A9%8D%E6%80%A7%E5%87%BD%E6%95%B8
If f (n) is multiplicative, then  is also multiplicative.
Φ(mn) = Φ(m)Φ(n) whenever (m,n) = 1

完全积性函数 completely multiplicative: If we can remove the restriction (m, n) = 1 and still have a(mn) = a(m) a(n).

加性函数 additive a(n): a(m + n) = a(m) + a(n)

https://zh.wikipedia.org/wiki/%E5%8A%A0%E6%80%A7%E5%87%BD%E6%95%B8

2. 小结论

(r,m)=1 ⇐⇒ there exists an integer such that ar+bm=1

Let p be a prime, and p ∤ a, then the inverse of a mod p is a^(p-2).

For all a and primes p, a^p ≡ a mod p.

Week 5

1. 概念

除数函数 The Divisor function: v(n)=τ(n)=d(n)=

https://zh.wikipedia.org/wiki/%E9%99%A4%E6%95%B8%E5%87%BD%E6%95%B8

d(n) is multiplicative.

d(p^a)=a+1, for every prime p and positive integer a.

Sum of the Divisors Function σ(n)=, σ(n) is multiplicative.

奇完全数 Perfect Numbers: n is perfect if σ(n) = 2n, i.e., n is perfect if the sum of the proper divisors of n is n.

n is an even perfect number ⇐⇒ n = 2^(p-1) · (2^p - 1), where p, 2^p - 1 are both primes.
n is perfect if σ(n) = 2n.

默比乌斯函数 Mobius Function μ(n):

https://zh.wikipedia.org/wiki/%E9%BB%98%E6%AF%94%E4%B9%8C%E6%96%AF%E5%87%BD%E6%95%B0

μ(n) is multiplicative.

莫比乌斯求逆公式  Mobius Inversion Formula:

Riemann zeta Function ζ(s):

二次剩余 quadratic residue: Let (a, m) = 1, m > 1. a is a quadratic residue modulo m if x^2 ≡ a mod m has a solution.

二次非剩余 quadratic nonresidue

Let p be an odd prime. Then x^2 ≡ a mod p, p ∤ a has either 2 incongruent solutions or 0 solutions.

Let p be an odd prime. Then ∃ (p-1)/2 quadratic residues mod p and (p-1)/2 quadratic nonresidues mod p.

2.python代码

判断是否为二次剩余以及求二次剩余

def euler_criterion(a, p):"""p is odd prime, a is positive integer. Euler's Criterion will check ifa is a quadratic residue mod p. If yes, returns True. If a is a non-residuemod p, then False"""return pow(a, (p - 1) // 2, p) == 1def results(a):for i in range(1,a):if euler_criterion(i, a):print(i)returnprint(euler_criterion(5,11))
print(results(11))

Week 6

1. 概念

勒让德符号 Legendre symbol :(≡0时,值为0)

https://zh.wikipedia.org/wiki/%E5%8B%92%E8%AE%A9%E5%BE%B7%E7%AC%A6%E5%8F%B7

欧拉准则 Euler’s Criterion: Let p be odd prime, p ∤ a. Then  .

https://zh.wikipedia.org/wiki/%E6%AC%A7%E6%8B%89%E5%87%86%E5%88%99

高斯引理 Gauss’s Lemma: Let p be an odd prime, p ∤ a. Let n = the number of least positive residues of a, 2a, 3a, . . . , (p−1)a/2 that are > p/2. Then ( a/p ) = (−1)^n.

二次互反性 Law of Quadratic Reciprocity: Let p, q be distinct, odd primes, then:

https://zh.wikipedia.org/wiki/%E4%BA%8C%E6%AC%A1%E4%BA%92%E5%8F%8D%E5%BE%8B#50%E4%BB%A5%E5%86%85%E7%9A%84%E8%B4%A8%E6%95%B0%E7%9A%84%E4%BA%8C%E6%AC%A1%E5%89%A9%E4%BD%99%E8%A1%A8

The Legendre–Jacobi Symbol (P/Q): P, Q integers , Q > 0 and odd, P Q ≠ 0. Q = q1q2 ⋯qs (product representation of Q into primes), then:

Let P, P′ ∈ Z, P ≠ 0, Q, Q′ are odd and positive. Then:

Week7

1. 概念

阶 Order of a mod m : the smallest positive integer n such that .

Let (a, m) = 1, m > 0. If , then .
A corollary would be that .

Let (a, m) = 1, m > 0. Let i, j ≥ 0, i, j ∈ Z, then .

(r, m) = 1, r^Φ(m) ≡ 1 mod m

原根 primitive root: r is a primitive root mod m if ord_m r = Φ(m).
imprimitive root: r is an imprimitive root mod m if ord_m r < Φ(m).

https://zh.wikipedia.org/wiki/%E5%8E%9F%E6%A0%B9

If r is a primitive root, then a set of reduce residues mod m is {r, r^2, . . . , r_Φ(m)}.

Let (a, m) = 1, m > 0, n ∈ Z+, then 
Let (a, m) = 1, m > 0, n ∈ Z+, then .

If a primitive root r mod m exists, then ∃ exactly Φ(Φ(m)) primitive roots mod m.计算原根数量

拉格朗日定理 Lagrange's Theorem: Let p be a prime. Let f(x) = , a_j ∈ Z, p ∤ a_n. Then f(x) ≡ 0 mod p has at most n incongruent solutions mod p.

Let p be a prime, d ∣ (p - 1). Then x^d - 1 ≡ 0 mod p has exactly d incongruent solutions mod p.

Let p be a prime, d ∈ Z+, d ∣ (p - 1). Then ∃ exactly Φ(d) incongruent integers having order d mod p.

∃ ∞-many primes for which 2 is the least primitive root.

Week 8

1. 概念

Theorem for Linear Diophantine Equations with Two Variables: Consider ax + by = c, where a, b, c ∈ Z ; d = (a, b). If d ∤ c, then 不∃ solutions. If d ∣ c, then ∃ infinitely many solutions.
Let (x0, y0) be a solution, then all solutions are given by x = x0 + nb/d ; y = y0 - na/d, n ∈ Z.

线性丢番图方程 linear Diophantine equation a1x1 + a2x2 + ::: + anxn = c:
1. x^2 + y^2 = z^2 (勾股方程 Pythagorean equation)
2. x^n + y^n = z^n; n ≥ 3 solved 1995, Andrew Wiles, no solutions
3. x^2 - dy^2 = n
4. x^3 + y^3 = w^3 + z^3 (taxicab equation)

本原勾股数 primitive Pythagorean triple (x, y, z): x^2 + y^2 = z^2 and (x, y, z)=1.
∃ infinitely many primitive Pythagorean triples with y even and they are given by:
x = m^2 - n^2
y = 2mn
z = m^2 + n^2
where m, n > 0 , m, n ∈ Z , (m, n) = 1 and one of them is even

Fermat’s Last Theorem

四平方和定理 Lagrange's four-square theorem:每个正整数均可表示为4个(不全为零的)整数的平方和。

2. 小结论

x^4+y^4=z^2 has no nonzero solutions in integers.

If n1, n2 can be written as a sum of 2 squares then n1n2 can be also written as a sum of 2 squares.

Let p be prime , p ≡ 1( mod 4). then ∃x; y ∈ Z; k ∈ Z+ such that x^2 + y^2 = kp.

Every prime p ≡ 1( mod 4) is expressible as a sum of 2 squares. Also p = 2 is so expressible.

Let n ∈ Z+. Then n = a^2 + b^2 ⇐⇒ each prime in the factorization of n that is ≡ 3( mod 4) has even exponent.

N = 4^m*(8n + 7) cannot be represented as a sum of 3 squares m = n = 0 N = 7.

Let n1, n2 be each expressible as a sum of 4 squares. Then n1n2 can be represented as a sum of 4 squares.

Let p be an odd prime, then there ∃x, y, k ∈ Z , 0 < k < p such that x^2 + y^2 + 1 = kp.

If p is a prime, then p = w^2 + x^2 + y^2 + z^2.

3.程序

将一个数表示为两个平方数之和

#遍历
def judgeSquareSum(c: int) -> bool:is_square = lambda n: not n ** 0.5 % 1      # 定义函数,判断一个数是不是平方数for i in range(int(c**0.5)+1):              # 遍历数字,注意范围if is_square(c-i**2):                   # 如果c-i^2是平方数return True                         # 返回Truereturn False                                # 不满足平方数之和的条件
#左右指针
def judgeSquareSum(c: int) -> bool:left, right = 0, int(c**0.5)+1              # 定义左右指针while left <= right:                        # 如果左指针没有跑到右指针右边rst = left * left + right * right       # 计算平方和if rst == c:                            # 如果平方和恰好等于结果return True                         # 说明目标值c是平方和elif rst < c:                           # 如果当前平方比目标值小left += 1                           # 左指针右移elif rst > c:                           # 如果当前平方比目标值大right -= 1                          # 右指针左移return False                                # 没有找到,返回False

多项式方程求解

import numpy as npp = np.array([1,-15,0,10,4,3])b = np.roots(p)#求根
print(b)r = np.real(b)#取实数
print(r)

Week 9

1. 概念

A character χ(n) has period p (prime) and is multiplicative, values are roots of unity, χ(n) = 0 if (n, p) > 1. χ(n) ≡ 1 trivial character.

高斯和 Gauss Sum G(α,χ)=

https://zh.wikipedia.org/wiki/%E9%AB%98%E6%96%AF%E5%92%8C
where α is an integer. G(1, χ) = G(χ).
G(α,χ) = χ(α^-1) G(χ), provided α ≠ 0 and α ≠ np.
=χ(-1)p where χ is nontrivial and α ≡/ 0
|G(α,χ)|=√p

g(β):

简单连分数 simple continued fraction [a0, a1, . . . , an]: if a1, . . . , an are positive integers and a0 ∈ Z.

Let α ∈ R. Then α ∈ Q ⇐⇒ α can be expressed as a finite simple continued fraction.

Let α = [a0, a1, . . . , an]. Let (pj, qj) = 1, 0 ≤ j ≤ n.

Let α be as before. Then C0 < C2 < C4 < ⋯C5 < C3 < C1.

q_j ≥ j, j ≥ 0.

Let α ∈ R. Then α ∈ R / Q ⇐⇒ α can be expressed as an infinite simple continued fraction.

Let α ∈ R / Q. Then the representation of α as an infinite continued fraction is unique.

Let α ∈ R / Q. Let p_n/q_n be the nth convergent to α. Let a, b ∈ Z, 0 < b < q_(n+1). Then ∣q_n α - p_n∣ ≤ ∣bα - a∣.

Let α ∈ R / Q. Let p_j/q_j be the jth convergence of a simple continued fraction of α. Let a, b ∈ Z, 1 ≤ b ≤ q_j. Then ∣α - p_j/q_j∣ ≤ ∣α - a/b∣.

[a0, a1, a2, . . .] is eventually periodic if ∃ positive integers N, P such that a_n = a_(n+p), n ≥ N.

2. 小结论

√2 is irrational

github上的项目

GitHub - Robert-Campbell-256/Number-Theory-Python: Python code to implement various number theory, elliptic curve and finite field computations.

初等数论及python应用相关推荐

  1. 数论及Python实践

    二项式系数 (x+y)n=(n0)xny0+(n1)xn−1y1+⋯+(nn)x0yn (x+y)^n={n \choose 0}x^ny^0+{n\choose 1}x^{n-1}y^1+\cdot ...

  2. Catalan 数之Python演示

    这里写自定义目录标题 Catalan 数之Python演示 带限制条件的路径总数 Python演示代码说明 Python代码 Catalan 数之Python演示 关于Catalan 数,英文的下面网 ...

  3. 找到1000以内的完数 利用Python实现

    找到1000以内的完数 利用Python实现 题目:一个数如果恰好等于它的因子之和,这个数就称为"完数".例如,6 的因子为1. 2.3,而6=1+2+3,因此6 是完数.编程,找 ...

  4. 爱数科技python开发岗面试

    爱数科技python开发岗,把自己面试收获给大家分享下 面试的题目 说一下TCP和UDP的区别? 说一下GIL的全局解释锁? Linux操作系统有什么特点? Linux的常用命令,简述下功能 进程和线 ...

  5. 蓝桥杯-幸运数(python)

    蓝桥杯-幸运数(python) 一.题目 时间限制: 1Sec 内存限制: 128MB 题目描述: 幸运数是波兰数学家乌拉姆命名的.它采用与生成素数类似的"筛法"生成 . 首先从1 ...

  6. 回文数判断python五位数_Python【习题】回文数:判断一个数是否是回文数

    人生苦短,我用Python 环境:Windows 10 64-bit, python == 3.6.4 , PyCharm CE == 2018.1 什么是回文数: 有这样一类数,他们顺着看和倒着看是 ...

  7. python统计中英文字符_如何统计文本中的中英文字符数?Python帮你解决

    本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理 以下文章来源于小蚊子数据分析 ,作者小蚊子数据分析 代码 1import stri ...

  8. 回文数判断 — Python实现

    题目描述 判断一个整数是否是回文数.回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数. 示例 1: 输入: 121 输出: true 示例 2: 输入: -121 输出: false Le ...

  9. python第四章答案猜数游戏_猜数游戏python

    广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 本文实例为大家分享了python实现猜数游戏的具体代码,供大家参考,具体内容如下 ...

  10. LDA主题模型绘制困惑度(perplexity)-主题数曲线——python

    主题建模作为一种基于机器学习的文本内容分析技术,一般用于推断文本文档中隐藏主题的技术.很多研究使用了基于Latent Dirichlet Allocation (LDA)的主题建模算法来处理大规模文档 ...

最新文章

  1. 关于计算机专业的求职信英文怎么说,计算机求职信范文英文3篇
  2. 成功解决AttributeError: ‘PathCollection‘ object has no property ‘n_levels‘
  3. [spring boot]自定义log配置文件名
  4. Mac下安装和使用GunPG(GPG)
  5. 索引sql server_SQL Server报告– SQL Server索引利用率
  6. Pandas计算同比环比指标的3种方法
  7. LaTex创建四级目录
  8. 六根清净怎么讲 ---圣严法师
  9. 工具类批量修改照片的名字
  10. vue/react/web前端项目部署到阿里云服务器_nginx_pm2流程及部署前的准备
  11. 通过ssh tunnel从外网访问内网kali
  12. 如何在嵌入式 Linux 和物联网中建立信任根
  13. 关于抓java的dump中live参数
  14. ALSA (高级Linux声音架构)、ASOC基础知识
  15. 12563 - Jin Ge Jin Qu hao(DP)
  16. 华硕笔记本计算机名称,华硕笔记本电脑型号命名规则详解.doc
  17. PHP过滤器之审查过滤器(Sanitize filters)
  18. 生物科技拿起生化朋克的剧本|AI的朋友二
  19. 加密算法之阮一峰大神博客摘抄
  20. 2022年电子产品行业现状

热门文章

  1. html设置右键失灵,鼠标右键失灵是怎么回事
  2. leetcode1114. 按序打印 靡不有初,鲜克有终,小白加油加油加油
  3. 导弹防御系统(LIS)
  4. MySQL 从入门到实践,万字详解!
  5. 13. 查询表orders——统计销售总量大于50的各类商品的ID和销售总量
  6. 从3D ToF到智能座舱系统方案,英飞凌如何赋能未来出行?
  7. IntelliJ IDEA 常用快捷键 ------ Windows / Mac 对比
  8. 计算机广告设计好不好找工作,大专学广告设计好就业吗 前景怎么样
  9. 公司网站被跳转到其他网站被提示该站点可能受到黑客攻击,部分页面已被非法篡改
  10. Java 标准 I/O 流编程一览笔录( 下 )