This document provides a summary of key concepts in elementary number theory and modular arithmetic, including definitions for integers, greatest common divisors, prime numbers, modular arithmetic, and continued fractions. It also briefly introduces elliptic curves and some of their key properties.
This document provides a summary of key concepts in elementary number theory and modular arithmetic, including definitions for integers, greatest common divisors, prime numbers, modular arithmetic, and continued fractions. It also briefly introduces elliptic curves and some of their key properties.
n = binomial(m,n) a modulo n as element of Z/nZ: Mod(a, n) EllipticCurve([0,0,1,-1,0]).plot(plot_points=300,thickness=3) digits in a given base: n.digits(base) primitive root modulo n = primitive root(n) 1.5 1 number of digits: n.ndigits(base) inverse of n (mod m): n.inverse mod(m) 0.5 -1 -0.5 0.5 1 1.5 -0.5 (base is optional and defaults to 10) power an (mod m): power mod(a, n, m) -1 -1.5 -2 divides n | m: n.divides(m) if nk = m some k Chinese remainder theorem: x = crt(a,b,m,n) divisors – all d with d | n: n.divisors() finds x with x ≡ a (mod m) and x ≡ b (mod n) E = EllipticCurve([a1 , a2 , a3 , a4 , a6 ]) factorial – n! = n.factorial() discrete log: log(Mod(6,7), Mod(3,7)) y 2 + a1 xy + a3 y = x3 + a2 x2 + a4 x + a6 order of a (mod n) =Mod(a,n).multiplicative order() Prime Numbers conductor N of E =E.conductor() square root of a (mod n) =Mod(a,n).sqrt() discriminant ∆ of E =E.discriminant() 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, . . . Special Functions rank of E = E.rank() factorization: factor(n) free generators for E(Q) = E.gens() primality testing: is prime(n), is pseudoprime(n) complex_plot(zeta, (-30,5), (-8,8)) j-invariant = E.j invariant() prime power testing: is prime power(n) 8 Np = #{solutions to E modulo p} = E.Np(prime) π(x) = #{p : p ≤ x is prime} = prime pi(x) 6 4 ap = p + 1 − Np =E.ap(prime) set of prime numbers: Primes() 2 P an -30 -25 -20 -15 -10 -5 5 L(E, s) = ns = E.lseries() {p : m ≤ p < n and p prime} =prime range(m,n) -2 -4 ords=1 L(E, s) = E.analytic rank() prime powers: prime powers(m,n) -6 -8 first n primes: primes first n(n) Elliptic Curves Modulo p next and previous primes: next prime(n), 1 1 EllipticCurve(GF(997), [0,0,1,-1,0]).plot() Q P previous prime(n), next probable prime(n) ζ(s) = p −s = ns = zeta(s) R x 1−p1 1000
prime powers: Li(x) = 2 log(t) dt = Li(x) 750
500
next prime power(n), pevious prime power(n) R∞
Γ(s) = 0 ts−1 e−t dt = gamma(s) 250
Lucas-Lehmer test for primality of 2p − 1 250 500 750 1000