Master divisibility rules and prime number theory through comprehensive SageMath computations. Explore fundamental concepts including divisors, multiples, prime factorization, and primality testing using computational number theory. Interactive Jupyter notebook on CoCalc demonstrates mathematical proofs with step-by-step SageMath code examples for deep understanding.
ubuntu2404
Divisibility and Prime Numbers: Foundations of Number Theory
Learning Objectives
By completing this notebook, you will:
Master the concept of divisibility and its properties
Understand prime numbers as fundamental building blocks
Apply the Euclidean algorithm for GCD computation
Use prime factorization to solve practical problems
Explore connections to cryptography and computer science
Prerequisites
Basic arithmetic operations
Understanding of multiplication and division
Familiarity with Python/SageMath syntax
Historical Context
Number theory, often called the "Queen of Mathematics" by Gauss, has ancient roots:
300 BCE: Euclid's Elements proved infinitely many primes exist and developed the Euclidean algorithm
250 CE: Diophantus studied integer solutions to equations
1640: Pierre de Fermat founded modern number theory with his famous theorems
1801: Carl Friedrich Gauss published Disquisitiones Arithmeticae, systematizing number theory
Today: Prime numbers secure internet communications through RSA encryption
What began as pure mathematics now protects billions of digital transactions daily!
Part 1: Divisibility - The Foundation
Definition
For integers and with , we say " divides " (written ) if there exists an integer such that:
Equivalently:
is a multiple of
is a divisor (or factor) of
(remainder is zero)
Properties
Reflexivity: for all
Transitivity: If and , then
Linear combination: If and , then for any integers
Part 2: Prime Numbers - The Atoms of Arithmetic
Definition
A natural number is prime if it has exactly two positive divisors: 1 and itself.
Fundamental Theorem of Arithmetic
Every integer can be represented uniquely as a product of prime powers:
where are primes and .
Why Primes Matter
Cryptography: RSA encryption relies on difficulty of factoring large numbers
Computer Science: Hash tables, random number generation
Nature: Cicada life cycles, crystal structures
Part 3: Prime Factorization
Every composite number can be uniquely decomposed into prime factors. This is like finding the "DNA" of a number.
Part 4: Greatest Common Divisor (GCD)
The GCD of two numbers is the largest positive integer that divides both. Euclid's algorithm (300 BCE) efficiently computes this:
Part 5: Least Common Multiple (LCM)
The LCM is the smallest positive integer divisible by both numbers.
Key Relationship
This beautiful relationship connects GCD and LCM!
Part 6: Real-World Applications
Interactive Exploration with CoCalc
CoCalc's SageMath environment provides powerful number theory tools:
Built-in Functions:
is_prime(),factor(),gcd(),lcm()Advanced Features: Miller-Rabin primality testing, quadratic sieve factoring
Symbolic Computation: Exact arithmetic, no floating-point errors
Visualization: Plot prime distributions, factor trees
Practice Exercises
Find all perfect numbers less than 10,000 (numbers equal to sum of proper divisors)
Implement the extended Euclidean algorithm to find Bézout coefficients
Explore twin primes (primes differing by 2) up to 1000
Factor Fermat numbers:
Investigate Goldbach's conjecture for even numbers up to 100
Summary
We've explored fundamental concepts in number theory:
Divisibility: The basic relationship between integers
Prime Numbers: The building blocks of all integers
Prime Factorization: Unique decomposition theorem
GCD and LCM: Connected by a beautiful relationship
Applications: From ancient algorithms to modern cryptography
These concepts form the foundation for advanced topics in:
Modular arithmetic and congruences
Quadratic residues and reciprocity
Elliptic curves and modern cryptography
Next Steps: Explore modular arithmetic and the Chinese Remainder Theorem!