Number theory: 50 theorems from primes to quadratic residues
Number theory flashcards in LaTeX: primes, gcd and the Euclidean algorithm, congruences, Fermat and Euler, the Chinese remainder theorem and quadratic residues.
Practice now
Study without an account
Scheduled with the default Askesis timings. Progress is saved in this browser.
All 50 cards
- 1What does mean?divides : for some integer
- 2If and , then…for all integers and
- 3Division algorithmFor integers and there are unique integers and with and
- 4Prime numberAn integer whose only positive divisors are and1 is neither prime nor composite.
- 5Fundamental theorem of arithmeticEvery integer greater than 1 is a product of primes, and that factorization is unique apart from the order of the factors
- 6Euclid’s lemmaIf a prime divides , then or
- 7If and , then…
- 8Euclid’s proof that there are infinitely many primesGiven primes , the number leaves remainder 1 when divided by each of them, so its prime factors are new primesThe number itself need not be prime: .
- 9To test whether is prime, which divisors must you try?Only the primes up toIf with , then .
- 10Sieve of EratosthenesList the numbers to . For each unmarked , which is prime, cross out the multiples of from on. What remains unmarked is prime
- 11Prime number theorem, where counts the primes up to
- 12Number of positive divisors ofExample: has divisors.
- 13gcd and lcm from prime factorizationsThe gcd takes each prime to the smaller of its two exponents; the lcm takes the largerand give and .
- 14Product of andfor positive integers and
- 15Euclidean algorithmReplace with until the remainder is ; the last nonzero remainder isIt works because .
- 16, , .
- 17Bézout’s identityFor integers and , not both zero, there are integers and withThe gcd is the smallest positive integer of the form . The extended Euclidean algorithm finds and .
- 18Coprime (relatively prime) integersIntegers and with
- 19When does have integer solutions?Exactly when
- 20All integer solutions of , given one solution, for integers , where
- 21What does mean?: and leave the same remainder when divided by
- 22If and , then…, and
- 23When can you cancel from ?When . In general,
- 24When does have an inverse modulo ?Exactly whenBézout gives it: if , then is the inverse of .
- 25Inverse of modulo, since
- 26How many solutions does have?None unless divides ; if it does, exactly solutions modulo
- 27When are the integers modulo a field?Exactly when is prime
- 28Why does the digit-sum test for divisibility by 3 and 9 work?Because , every power of 10 is , so a number is congruent to its digit sum modulo 9, and so also modulo 3
- 29Computing efficientlyRepeated squaring: square repeatedly, multiply in the powers that match the 1 bits of , and reduce modulo at each stepIt takes at most multiplications instead of .
- 30Fermat’s little theoremIf is prime and , thenEquivalently, for every integer .
- 31and , so .
- 32Euler’s totientThe number of integers from to that are coprime to
- 33for a primeIn particular .
- 34Formula for from the prime factors ofis multiplicative: when .
- 35
- 36Euler’s theoremIf , thenFermat’s little theorem is the case .
- 37Order of moduloThe smallest with , for ; it always divides
- 38Primitive root moduloAn whose order modulo is , so its powers run through every residue coprime toPrimitive roots exist exactly when is , , , or for an odd prime .
- 39Carmichael numberA composite with for every coprime to , so it passes the Fermat primality test for all such basesThe smallest is .
- 40Wilson’s theoremAn integer is prime exactly whenExample: .
- 41Chinese remainder theoremIf are pairwise coprime, the system has exactly one solution modulo
- 42Solve , ,The classic puzzle from the Sunzi Suanjing, a Chinese text from around the 3rd to 5th century.
- 43Quadratic residue moduloAn coprime to for which has a solution
- 44Quadratic residues modulo, andThe squares of are modulo 7.
- 45How many nonzero quadratic residues are there modulo an odd prime ?Exactly ; the other nonzero residues are non-residues
- 46Legendre symbolif is a quadratic residue modulo the odd prime , if it is a non-residue, and if
- 47Euler’s criterionfor an odd prime
- 48When is a quadratic residue modulo an odd prime ?Exactly when
- 49Law of quadratic reciprocityFor distinct odd primes and :So the two symbols are equal unless both and are .
- 50Which odd primes are a sum of two squares?Exactly those withFermat’s theorem on sums of two squares; for example .
Frequently asked questions
What background do I need?
Comfort with algebra and simple proofs. The deck matches a first course in elementary number theory or the number theory part of discrete math.
Is it useful for cryptography?
Yes. Modular inverses, fast exponentiation, Fermat’s and Euler’s theorems and the Chinese remainder theorem are the math behind RSA and Diffie–Hellman.
Does it help with math competitions?
It covers the core results that olympiad number theory problems build on, though competitions go much further.
How are formulas displayed?
With LaTeX rendered by KaTeX, so congruences and symbols look like your textbook.
More in Math
Calculus
Memorize the derivatives, integrals, limits and theorems every calculus course relies on, written out in clean LaTeX.
50 cardsStatistics
Learn the statistics every course and data job relies on: variance, the normal distribution, hypothesis tests, regression and probability rules, with formulas in clean LaTeX.
50 cardsLinear algebra
Vectors, matrices, determinants, eigenvalues, orthogonality and the SVD: the linear algebra behind machine learning and engineering, in 50 LaTeX flashcards.
50 cards