Sum of low squares
Explores quadratic residues modulo primes, focusing on low squares and a unique signature property for primes congruent to 3 mod 4.
Explores quadratic residues modulo primes, focusing on low squares and a unique signature property for primes congruent to 3 mod 4.
Explains how to compute a square root of -1 modulo a prime p, using number theory and Python code examples.
Explores Fermat's theorem on expressing primes as sums of two squares, comparing Gauss's formula with a more efficient computational algorithm.
Explains Montgomery's trick for efficiently computing multiple modular inverses at once, with Python code examples and performance comparison.
Explains the math and Python code for perfect in-shuffles and out-shuffles, comparing how many shuffles restore a deck's order.