<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Number Theory on Teddy Rook Book</title><link>https://teddyrookbook.com/math/number-theory/</link><description>Recent content in Number Theory on Teddy Rook Book</description><image><title>Teddy Rook Book</title><url>https://teddyrookbook.com/img/share.jpg</url><link>https://teddyrookbook.com/img/share.jpg</link></image><generator>Hugo</generator><language>en</language><atom:link href="https://teddyrookbook.com/math/number-theory/index.xml" rel="self" type="application/rss+xml"/><item><title>Divisibility</title><link>https://teddyrookbook.com/math/number-theory/divisibility/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/divisibility/</guid><description>a ∣ b means b = ak for some integer k; if a divides b and c, it divides every combination mb + nc. Number Theory · Math Ladder</description></item><item><title>The Division Algorithm</title><link>https://teddyrookbook.com/math/number-theory/division-algorithm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/division-algorithm/</guid><description>For a positive divisor b, every integer a can be written as a = bq + r with 0 ≤ r &amp;lt; b, even when a is negative. Number Theory · Math Ladder</description></item><item><title>Writing Numbers in Other Bases</title><link>https://teddyrookbook.com/math/number-theory/number-bases/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/number-bases/</guid><description>Convert to base b by dividing by b again and again, then read the remainders from last to first. Number Theory · Math Ladder</description></item><item><title>The Euclidean Algorithm</title><link>https://teddyrookbook.com/math/number-theory/euclidean-algorithm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/euclidean-algorithm/</guid><description>gcd(a, b) = gcd(b, r), where r is the remainder when a is divided by b; repeat until the remainder is 0. Number Theory · Math Ladder</description></item><item><title>Bézout's Identity and the Extended Euclidean Algorithm</title><link>https://teddyrookbook.com/math/number-theory/bezout/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/bezout/</guid><description>Work the Euclidean algorithm backward to write gcd(a, b) = ax + by. Number Theory · Math Ladder</description></item><item><title>Linear Diophantine Equations</title><link>https://teddyrookbook.com/math/number-theory/linear-diophantine/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/linear-diophantine/</guid><description>ax + by = c has integer solutions exactly when d = gcd(a, b) divides c, and then x = x₀ + (b/d)t, y = y₀ − (a/d)t. Number Theory · Math Ladder</description></item><item><title>Testing Primes and the Sieve of Eratosthenes</title><link>https://teddyrookbook.com/math/number-theory/primality-sieve/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/primality-sieve/</guid><description>n is prime when no prime up to √n divides it; the sieve crosses out multiples to list every prime up to N. Number Theory · Math Ladder</description></item><item><title>Unique Prime Factorization</title><link>https://teddyrookbook.com/math/number-theory/unique-factorization/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/unique-factorization/</guid><description>Every integer above 1 is a product of primes in exactly one way, because a prime that divides ab divides a or b (Euclid&amp;#39;s lemma). Number Theory · Math Ladder</description></item><item><title>gcd and lcm from Prime Factorizations</title><link>https://teddyrookbook.com/math/number-theory/gcd-lcm-factorizations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/gcd-lcm-factorizations/</guid><description>Take the smaller exponent of each prime for the gcd and the larger for the lcm; then gcd(a, b) · lcm(a, b) = ab. Number Theory · Math Ladder</description></item><item><title>Counting and Adding Divisors</title><link>https://teddyrookbook.com/math/number-theory/divisor-functions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/divisor-functions/</guid><description>If n = p₁^a₁ ⋯ pₖ^aₖ, then n has (a₁ + 1)⋯(aₖ + 1) divisors, and their sum σ(n) is a product of geometric sums. Number Theory · Math Ladder</description></item><item><title>Perfect Numbers and Mersenne Primes</title><link>https://teddyrookbook.com/math/number-theory/perfect-numbers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/perfect-numbers/</guid><description>n is perfect when σ(n) = 2n; whenever 2ᵖ − 1 is prime, 2ᵖ⁻¹(2ᵖ − 1) is perfect. Number Theory · Math Ladder</description></item><item><title>Prime Powers in n!</title><link>https://teddyrookbook.com/math/number-theory/factorial-primes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/factorial-primes/</guid><description>The exponent of p in n! is ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + ⋯, so 100! ends in 24 zeros. Number Theory · Math Ladder</description></item><item><title>Infinitely Many Primes</title><link>https://teddyrookbook.com/math/number-theory/infinitely-many-primes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/infinitely-many-primes/</guid><description>Euclid&amp;#39;s argument: p₁p₂⋯pₖ + 1 has a prime factor that is not on the list p₁, …, pₖ. Number Theory · Math Ladder</description></item><item><title>How Common Are Primes?</title><link>https://teddyrookbook.com/math/number-theory/prime-counting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/prime-counting/</guid><description>The prime number theorem: there are about x/ln x primes up to x. Primes thin out, and n! + 2, …, n! + n is a run of n − 1 composite numbers. Number Theory · Math Ladder</description></item><item><title>Congruence mod n</title><link>https://teddyrookbook.com/math/number-theory/congruence/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/congruence/</guid><description>a ≡ b (mod n) when n ∣ (a − b), that is, when a and b leave the same remainder on division by n. Number Theory · Math Ladder</description></item><item><title>Arithmetic mod n</title><link>https://teddyrookbook.com/math/number-theory/modular-arithmetic/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/modular-arithmetic/</guid><description>Reduce first, then add, subtract and multiply: the result is the same as reducing at the end. Number Theory · Math Ladder</description></item><item><title>Divisibility Tests from Congruences</title><link>https://teddyrookbook.com/math/number-theory/divisibility-tests/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/divisibility-tests/</guid><description>Since 10 ≡ 1 (mod 9) and 10 ≡ −1 (mod 11), digit sums and alternating digit sums test divisibility by 9 and by 11. Number Theory · Math Ladder</description></item><item><title>Fast Powers mod n</title><link>https://teddyrookbook.com/math/number-theory/modular-powers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/modular-powers/</guid><description>Square again and again, multiply the powers that match the binary digits of the exponent, and reduce after every step. Number Theory · Math Ladder</description></item><item><title>Modular Inverses</title><link>https://teddyrookbook.com/math/number-theory/modular-inverses/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/modular-inverses/</guid><description>a has an inverse mod n exactly when gcd(a, n) = 1; find it with the extended Euclidean algorithm. Number Theory · Math Ladder</description></item><item><title>Linear Congruences</title><link>https://teddyrookbook.com/math/number-theory/linear-congruences/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/linear-congruences/</guid><description>ax ≡ b (mod n) has no solution unless d = gcd(a, n) divides b, and then it has exactly d solutions mod n. Number Theory · Math Ladder</description></item><item><title>The Chinese Remainder Theorem</title><link>https://teddyrookbook.com/math/number-theory/chinese-remainder/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/chinese-remainder/</guid><description>When m and n are coprime, the pair x ≡ a (mod m), x ≡ b (mod n) has exactly one solution mod mn. Number Theory · Math Ladder</description></item><item><title>Fermat's Little Theorem</title><link>https://teddyrookbook.com/math/number-theory/fermat-little/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/fermat-little/</guid><description>If p is prime and p ∤ a, then aᵖ⁻¹ ≡ 1 (mod p), so exponents can be reduced mod p − 1. Number Theory · Math Ladder</description></item><item><title>Wilson's Theorem</title><link>https://teddyrookbook.com/math/number-theory/wilson/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/wilson/</guid><description>An integer p &amp;gt; 1 is prime exactly when (p − 1)! ≡ −1 (mod p): the factors from 2 to p − 2 pair up with their inverses, leaving 1 · (p − 1) ≡ −1. Number Theory · Math Ladder</description></item><item><title>Euler's Phi Function</title><link>https://teddyrookbook.com/math/number-theory/euler-phi/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/euler-phi/</guid><description>φ(n) counts the k from 1 to n with gcd(k, n) = 1; φ(pᵏ) = pᵏ − pᵏ⁻¹, and φ(mn) = φ(m)φ(n) when gcd(m, n) = 1. Number Theory · Math Ladder</description></item><item><title>Euler's Theorem</title><link>https://teddyrookbook.com/math/number-theory/euler-theorem/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/euler-theorem/</guid><description>If gcd(a, n) = 1, then a^φ(n) ≡ 1 (mod n); use it to find the last digits of huge powers. Number Theory · Math Ladder</description></item><item><title>Fermat Tests and Pseudoprimes</title><link>https://teddyrookbook.com/math/number-theory/pseudoprimes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/pseudoprimes/</guid><description>If aⁿ⁻¹ ≢ 1 (mod n) for some a with 1 &amp;lt; a &amp;lt; n, then n is composite; passing the test does not prove that n is prime. Number Theory · Math Ladder</description></item><item><title>The Order of an Element</title><link>https://teddyrookbook.com/math/number-theory/order-mod-n/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/order-mod-n/</guid><description>The order of a mod n is the smallest k &amp;gt; 0 with aᵏ ≡ 1; it divides φ(n), and the powers of a repeat with that period. Number Theory · Math Ladder</description></item><item><title>Primitive Roots</title><link>https://teddyrookbook.com/math/number-theory/primitive-roots/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/primitive-roots/</guid><description>g is a primitive root mod p when its order is p − 1, so its powers reach every nonzero residue; check that g^((p − 1)/q) ≢ 1 for each prime q dividing p − 1. Number Theory · Math Ladder</description></item><item><title>Discrete Logarithms</title><link>https://teddyrookbook.com/math/number-theory/discrete-logs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/discrete-logs/</guid><description>With a primitive root g mod p, every nonzero residue is gᵏ for exactly one k mod p − 1; checking a k is easy, finding one is slow. Number Theory · Math Ladder</description></item><item><title>Shift and Affine Ciphers</title><link>https://teddyrookbook.com/math/number-theory/affine-ciphers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/affine-ciphers/</guid><description>Encrypt letters with x ↦ ax + b (mod 26) and decrypt with x ↦ a⁻¹(x − b); a must be coprime to 26. Number Theory · Math Ladder</description></item><item><title>Diffie–Hellman Key Exchange</title><link>https://teddyrookbook.com/math/number-theory/diffie-hellman/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/diffie-hellman/</guid><description>Two people agree on a secret g^(ab) mod p while sharing only gᵃ and gᵇ in public. Number Theory · Math Ladder</description></item><item><title>The RSA Cryptosystem</title><link>https://teddyrookbook.com/math/number-theory/rsa/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/rsa/</guid><description>The public key is (n, e) with n = pq; the private key d ≡ e⁻¹ (mod φ(n)); encrypt with c ≡ mᵉ and decrypt with m ≡ cᵈ (mod n). Number Theory · Math Ladder</description></item><item><title>Squares mod p</title><link>https://teddyrookbook.com/math/number-theory/quadratic-residues/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/quadratic-residues/</guid><description>a is a quadratic residue mod p when x² ≡ a has a solution; for an odd prime p, exactly half of the nonzero residues are squares. Number Theory · Math Ladder</description></item><item><title>The Legendre Symbol and Euler's Criterion</title><link>https://teddyrookbook.com/math/number-theory/euler-criterion/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/euler-criterion/</guid><description>For p ∤ a, (a/p) is 1 when a is a square mod p and −1 when it is not, and (a/p) ≡ a^((p − 1)/2) (mod p). Number Theory · Math Ladder</description></item><item><title>Is −1 or 2 a Square mod p?</title><link>https://teddyrookbook.com/math/number-theory/supplementary-laws/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/supplementary-laws/</guid><description>−1 is a square mod an odd prime p exactly when p ≡ 1 (mod 4), and 2 is a square exactly when p ≡ ±1 (mod 8). Number Theory · Math Ladder</description></item><item><title>Quadratic Reciprocity</title><link>https://teddyrookbook.com/math/number-theory/quadratic-reciprocity/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/quadratic-reciprocity/</guid><description>For odd primes p ≠ q, (p/q) = (q/p), except when p ≡ q ≡ 3 (mod 4), when (p/q) = −(q/p). Number Theory · Math Ladder</description></item><item><title>Pythagorean Triples</title><link>https://teddyrookbook.com/math/number-theory/pythagorean-triples/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/pythagorean-triples/</guid><description>Every primitive triple is (m² − n², 2mn, m² + n²), up to the order of the legs, with m &amp;gt; n &amp;gt; 0, m and n coprime and of opposite parity. Number Theory · Math Ladder</description></item><item><title>Sums of Two Squares</title><link>https://teddyrookbook.com/math/number-theory/sums-of-two-squares/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/sums-of-two-squares/</guid><description>n is a sum of two squares exactly when every prime ≡ 3 (mod 4) appears in its factorization to an even power. Number Theory · Math Ladder</description></item><item><title>Continued Fractions of Rational Numbers</title><link>https://teddyrookbook.com/math/number-theory/continued-fractions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/continued-fractions/</guid><description>The quotients of the Euclidean algorithm give a/b = [q₀; q₁, q₂, …], and the convergents are better and better approximations. Number Theory · Math Ladder</description></item><item><title>Continued Fractions of Square Roots</title><link>https://teddyrookbook.com/math/number-theory/irrational-continued-fractions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/irrational-continued-fractions/</guid><description>When d is not a perfect square, √d has a repeating continued fraction, and its convergents are the best rational approximations: no fraction with a smaller denominator comes closer. Number Theory · Math Ladder</description></item><item><title>Pell's Equation</title><link>https://teddyrookbook.com/math/number-theory/pell-equation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://teddyrookbook.com/math/number-theory/pell-equation/</guid><description>For d &amp;gt; 0 not a perfect square, x² − dy² = 1 has a smallest solution with y &amp;gt; 0, found among the convergents of √d, and the powers of x₁ + y₁√d give all the others. Number Theory · Math Ladder</description></item></channel></rss>