Overview
Number sense is the backbone of contest math. You should be comfortable with divisibility tests, prime factorizations, and the Euclidean algorithm. Many problems reduce to checking a remainder or rewriting a number in prime powers.
This module covers divisibility, primes, gcd/lcm, and modular arithmetic with simple but powerful tools.
Key Ideas
- If and , then for any integers .
- The Euclidean algorithm computes quickly by repeated remainders.
- Working modulo lets you replace numbers by their remainders without changing divisibility information.
- Prime factorization turns lcm/gcd questions into exponent comparisons.
- Parity and mod 2/3/5/9 are quick sanity checks.
Core Tools
Divisibility
- If and , then for any integers .
- If and , then .
GCD and LCM
- .
- Use prime factorization: gcd uses min exponents, lcm uses max exponents.
Euclidean Algorithm
Compute by repeated remainders:
Modular Arithmetic
You can add, subtract, and multiply residues:
If , then .
Worked Example
Find the remainder of when divided by .
Because , we have . Since is even, . We can use the cycle with period . Compute , so the remainder is .
More Examples
Example 1: GCD via Euclid
Compute .
, , , . So .
Example 2: LCM from Prime Factors
Find .
, , so lcm is .
Example 3: Quick Divisibility
Is divisible by ? Sum of digits is , divisible by , so is divisible by .
Strategy Checklist
- Can you reduce the problem to prime factorization?
- Is Euclid faster than factoring?
- Can a small modulus simplify the expression?
- Does parity or a digit test give a quick answer?
Common Pitfalls
- Forgetting that congruence only preserves addition and multiplication.
- Mixing up and relationships.
- Treating as valid in modular arithmetic when is not invertible.
Practice Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
| AMC 8 | Easy | Show TagsDivisibility, Remainders | ||||
| AMC 10 | Easy | Show TagsGCD, Prime Factorization | ||||
| AJHSME | Very Easy | Show TagsCancellation, Fractions | ||||
| AJHSME | Very Easy | Show TagsAverages, Fractions, Number Line | ||||
| AJHSME | Very Easy | Show TagsRates, Unit Conversion | ||||
| AJHSME | Very Easy | Show TagsComparing Fractions, Reciprocals | ||||
| AJHSME | Very Easy | Show TagsNegative Numbers, Optimization | ||||
| AJHSME | Very Easy | Show TagsDecimals, Estimation | ||||
| AJHSME | Very Easy | Show TagsTime Calculation, Unit Conversion | ||||
| AJHSME | Very Easy | Show TagsComplex Fractions | ||||
| AJHSME | Very Easy | Show TagsEstimating Irrationals, Square Roots | ||||
| AJHSME | Very Easy | Show TagsCryptarithmetic, Digit Manipulation | ||||
| AJHSME | Very Easy | Show TagsLinear Measurement, Symmetry | ||||
| AJHSME | Very Easy | Show TagsCustom Operations | ||||
| AJHSME | Easy | Show TagsData Interpretation, Percentages | ||||
| AJHSME | Easy | Show TagsFractions, Optimization | ||||
| AJHSME | Very Easy | Show TagsPercent Discount, Sequential Discounts | ||||
| AJHSME | Easy | Show TagsData Interpretation, Percentages | ||||
| AJHSME | Easy | Show TagsParity, Polynomial Expressions | ||||
| AJHSME | Easy | Show TagsFencing Problem, Spacing Posts | ||||
| AJHSME | Easy | Show TagsAverage Rate, Miles Per Gallon | ||||
| AJHSME | Easy | Show TagsEstimation, Exponents | ||||
| AJHSME | Easy | Show TagsImplications, Logical Reasoning | ||||
| AJHSME | Very Easy | Show TagsDecimal Addition | ||||
| AJHSME | Very Easy | Show TagsFraction to Decimal | ||||
| AJHSME | Very Easy | Show TagsNegative Numbers, Products | ||||
| AJHSME | Very Easy | Show TagsAddition, Digit Bounds | ||||
| AJHSME | Easy | Show TagsFractions, Least Common Multiple | ||||
| AJHSME | Easy | Show TagsEstimation, Fractions | ||||
| AJHSME | Easy | Show TagsComparing Fractions | ||||
| AJHSME | Easy | Show TagsCounterexample, Logic, Prime Numbers | ||||
| AJHSME | Easy | Show TagsCustom Operations, Fractions | ||||
| AJHSME | Very Easy | Show TagsDecimals, Reading a Scale | ||||
| AJHSME | Very Easy | Show TagsDecimal Multiplication, Fractions | ||||
| AJHSME | Very Easy | Show TagsDecimals, Fractions, Simplifying Fractions | ||||
| AJHSME | Very Easy | Show TagsDecimals, Exponents | ||||
| AJHSME | Very Easy | Show TagsDecimals, Estimation | ||||
| AJHSME | Very Easy | Show TagsDecimal Placement, Decimals | ||||
| AJHSME | Very Easy | Show TagsCalendars, Modulo Arithmetic | ||||
| AJHSME | Very Easy | Show TagsEstimation, Square Roots | ||||
| AJHSME | Very Easy | Show TagsFactors, Maximization | ||||
| AJHSME | Very Easy | Show TagsFractions, Reciprocals | ||||
| AJHSME | Very Easy | Show TagsAddition, Grouping | ||||
| AJHSME | Very Easy | Show TagsDecimals, Fractions | ||||
| AJHSME | Very Easy | Show TagsComparing Numbers, Decimals | ||||
| AJHSME | Very Easy | Show TagsEstimation, Fractions | ||||
| AJHSME | Very Easy | Show TagsOrder of Operations | ||||
| AJHSME | Very Easy | Show TagsDistributive Property, Fractions | ||||
| AJHSME | Very Easy | Show TagsComplex Fractions, Fractions | ||||
| AJHSME | Easy | Show TagsDecimals, Fractions | ||||
| AJHSME | Easy | Show TagsPrimes, Sum of Primes | ||||
| AJHSME | Normal | Show TagsCycles, Least Common Multiple | ||||
| AJHSME | Very Easy | Show TagsAddition, Optimization, Place Value | ||||
| AJHSME | Very Easy | Show TagsDecimals, Place Value | ||||
| AJHSME | Very Easy | Show TagsPerfect Squares, Units Digit | ||||
| AJHSME | Very Easy | Show TagsDecimals, Estimation | ||||
| AJHSME | Very Easy | Show TagsEstimation, Fractions, Operations | ||||
| AJHSME | Very Easy | Show TagsNegative Numbers, Optimization | ||||
| AJHSME | Easy | Show TagsLogic, Spatial Reasoning | ||||
| AJHSME | Normal | Show TagsDivision, Modulo Arithmetic | ||||
| AJHSME | Very Easy | Show TagsArithmetic | ||||
| AJHSME | Very Easy | Show TagsFractions, Order of Operations | ||||
| AJHSME | Very Easy | Show TagsLarge Numbers, Word to Number Conversion | ||||
| AJHSME | Easy | Show TagsArrays, Min-Max | ||||
| AJHSME | Easy | Show TagsEstimation, Factoring | ||||
| AJHSME | Easy | Show TagsNegative Numbers, Quotients | ||||
| AJHSME | Normal | Show TagsPrime Factorization, Trailing Zeros | ||||
| AJHSME | Normal | Show TagsOptimization, Worst-Case Scenario | ||||
| AJHSME | Normal | Show TagsCryptarithm, Digit Addition | ||||
| AJHSME | Very Easy | Show TagsFractions, Order of Operations | ||||
| AJHSME | Very Easy | Show TagsFractions | ||||
| AJHSME | Very Easy | Show TagsExtremal Principle, Negative Numbers, Subtraction | ||||
| AJHSME | Very Easy | Show TagsFractions, Multiplication, Negative Numbers | ||||
| AJHSME | Very Easy | Show TagsFractions, Simplification | ||||
| AJHSME | Very Easy | Show TagsDivisibility, Prime Factorization | ||||
| AJHSME | Very Easy | Show TagsDecimals, Powers of 10, Scientific Notation | ||||
| AJHSME | Easy | Show TagsCombinatorics, Order of Operations | ||||
| AJHSME | Easy | Show TagsContinued Fractions, Simplification | ||||
| AJHSME | Normal | Show TagsDigit Sums, Patterns | ||||
| AJHSME | Very Easy | Show TagsComparing Fractions, Fractions | ||||
| AJHSME | Very Easy | Show TagsAddition, Fractions | ||||
| AJHSME | Easy | Show TagsConsecutive Integers, Units Digit | ||||
| AJHSME | Easy | Show TagsDivisibility, Factors | ||||
| AJHSME | Very Easy | Show TagsAverages, Fractions | ||||
| AJHSME | Normal | Show TagsFractions, Minimization | ||||
| AJHSME | Normal | Show TagsCryptarithm, Digit Addition | ||||
| AJHSME | Hard | Show TagsDigit Sum, Pattern Recognition | ||||
| AJHSME | Very Easy | Show TagsFraction Operations | ||||
| AJHSME | Very Easy | Show TagsEstimation, Fractions | ||||
| AJHSME | Normal | Show TagsModular Arithmetic, Repeating Decimals | ||||
| AJHSME | Normal | Show TagsPrime Factorization | ||||
| AJHSME | Very Easy | Show TagsFactors, Multiples | ||||
| AJHSME | Very Easy | Show TagsCorner Sum, Grid | ||||
| AJHSME | Very Easy | Show TagsMinimization | ||||
| AJHSME | Easy | Show TagsCross Sum, Digit Placement | ||||
| AJHSME | Easy | Show TagsModular Arithmetic, Units Digit | ||||
| AJHSME | Very Easy | Show TagsDecimal Conversion, Fractions | ||||
| AJHSME | Very Easy | Show TagsDecimals, Ordering | ||||
| AJHSME | Very Easy | Show TagsDigit Sum, Multiples | ||||
| AJHSME | Very Easy | Show TagsPlace Value, Powers of 10 | ||||
| AJHSME | Easy | Show TagsCustom Operations, Divisors | ||||
| AJHSME | Hard | Show TagsDigit Manipulation, Diophantine Equations | ||||
| AJHSME | Hard | Show TagsModular Arithmetic, Units Digit | ||||
| AJHSME | Very Easy | Show TagsEvaluating Expressions, Fractions | ||||
| AJHSME | Very Easy | Show TagsFractions, Order of Operations | ||||
| AJHSME | Very Easy | Show TagsDecimals, Repeating Decimals | ||||
| AJHSME | Easy | Show TagsDecimals, Exponents, Multiplication | ||||
| AMC 8 | Very Easy | Show TagsBasic Arithmetic, Order of Operations | ||||
| AMC 8 | Very Easy | Show TagsAddition, Decimals, Fractions | ||||
| AMC 8 | Easy | Show TagsPercentages, Ratios | ||||
| AMC 8 | Easy | Show TagsPercentages, System of Equations | ||||
| AMC 8 | Normal | Show TagsModular Arithmetic, Patterns, Units Digit | ||||
| AMC 8 | Very Easy | Show TagsInequalities, Reciprocals | ||||
| AMC 8 | Very Easy | Show TagsCounting Integers, Number Line | ||||
| AMC 8 | Easy | Show TagsNegative Numbers, Optimization, Products | ||||
| AMC 8 | Normal | Show TagsCrossword, Digit Analysis, Powers | ||||
| AMC 8 | Normal | Show TagsDigit Manipulation, Divisibility | ||||
| AMC 8 | Easy | Show TagsModular Arithmetic, Units Digit | ||||
| AMC 8 | Normal | Show TagsAverages, Overlapping Sets | ||||
| AMC 8 | Very Easy | Show TagsDigit Manipulation, Parity | ||||
| AMC 8 | Very Easy | Show TagsMoney, Percentages | ||||
| AMC 8 | Easy | Show TagsData Interpretation, Percentages | ||||
| AMC 8 | Normal | Show TagsDivisibility Rules, Permutations | ||||
| AMC 8 | Very Easy | Show TagsDigit Manipulation, Palindromes | ||||
| AMC 8 | Easy | Show TagsCalendar Math, Modular Arithmetic | ||||
| AMC 8 | Easy | Show TagsMoney, Table Reading | ||||
| AMC 8 | Very Easy | Show TagsDivisibility, Prime Factorization | ||||
| AMC 8 | Very Easy | Show TagsFractions, Percentages | ||||
| AMC 8 | Very Easy | Show TagsPercentages, Proportions | ||||
| AMC 8 | Easy | Show TagsDiscounts, Percentages | ||||
| AMC 8 | Normal | Show TagsCryptarithm, Digit Manipulation | ||||
| AMC 8 | Normal | Show TagsDivisibility, Least Common Multiple | ||||
| AMC 8 | Normal | Show TagsModular Arithmetic, Patterns | ||||
| AMC 8 | Easy | Show TagsLCM, Remainders | ||||
| AMC 8 | Very Easy | Show TagsMultiples, Optimization | ||||
| AMC 8 | Very Easy | Show TagsDecimals, Inequalities | ||||
| AMC 8 | Very Easy | Show TagsParity | ||||
| AMC 8 | Easy | Show TagsModular Arithmetic | ||||
| AMC 8 | Normal | Show TagsBinary, Working Backwards | ||||
| AMC 8 | Very Easy | Show TagsDirections, Fractions, Rotations | ||||
| AMC 8 | Normal | Show TagsAddition, Maximum and Minimum, Optimization | ||||
| AMC 8 | Normal | Show TagsChinese Remainder Theorem, Modular Arithmetic | ||||
| AMC 8 | Normal | Show TagsCryptarithm, Digit Puzzles | ||||
| AMC 8 | Normal | Show TagsAverages, Logic, Prime Numbers | ||||
| AMC 8 | Very Easy | Show TagsPrime Factorization | ||||
| AMC 8 | Easy | Show TagsCustom Operations, Sum of Divisors | ||||
| AMC 8 | Hard | Show TagsDigit Analysis, Multiplication | ||||
| AMC 8 | Very Easy | Show TagsCryptarithm, Digit Substitution | ||||
| AMC 8 | Easy | Show TagsCompound Interest, Percentages | ||||
| AMC 8 | Easy | Show TagsDivisibility, Factors | ||||
| AMC 8 | Normal | Show TagsPerfect Cubes, Perfect Squares, Prime Factorization | ||||
| AMC 8 | Hard | Show TagsAlgebra, Cryptarithm, Digits | ||||
| AMC 8 | Very Easy | Show TagsAddition | ||||
| AMC 8 | Normal | Show TagsPrime Factorization | ||||
| AMC 8 | Normal | Show TagsDigit Manipulation, Place Value | ||||
| AMC 8 | Very Easy | Show TagsPatterns, Ratios | ||||
| AMC 8 | Very Easy | Show TagsModular Arithmetic, Time Conversion | ||||
| AMC 8 | Easy | Show TagsPrime Factorization | ||||
| AMC 8 | Normal | Show TagsLogic, Prime Numbers | ||||
| AMC 8 | Normal | Show TagsModular Arithmetic, Patterns | ||||
| AMC 8 | Normal | Show TagsParity, Prime Numbers | ||||
| AMC 8 | Easy | Show TagsModular Arithmetic, Patterns, Units Digit | ||||
| AMC 8 | Easy | Show TagsDivisibility, Word Problems | ||||
| AMC 8 | Easy | Show TagsLeast Common Multiple, Remainders | ||||
| AMC 8 | Easy | Show TagsOptimization, Place Value | ||||
| AMC 8 | Normal | Show TagsNumber Theory, Prime Factorization | ||||
| AMC 8 | Easy | Show TagsFractions, Inequalities | ||||
| AMC 8 | Very Easy | Show TagsDivisibility, Remainders | ||||
| AMC 8 | Very Easy | Show TagsPercentages, Proportions | ||||
| AMC 8 | Easy | Show TagsGCD, LCM, Prime Factorization | ||||
| AMC 8 | Easy | Show TagsDigit Manipulation, Divisibility by 9 | ||||
| AMC 8 | Very Easy | Show TagsOrder of Operations | ||||
| AMC 8 | Very Easy | Show TagsCoins, Optimization | ||||
| AMC 8 | Very Easy | Show TagsParity, Prime Numbers | ||||
| AMC 8 | Very Easy | Show TagsDivisibility Rules | ||||
| AMC 8 | Easy | Show TagsParity | ||||
| AMC 8 | Normal | Show TagsDigits, Divisibility Rules | ||||
| AMC 8 | Easy | Show TagsAlgebraic Manipulation, Divisibility, Parity | ||||
| AMC 8 | Normal | Show TagsDivisors, Factors | ||||
| AMC 8 | Normal | Show TagsLogic, Partitioning | ||||
| AMC 8 | Very Easy | Show TagsModular Arithmetic, Remainders | ||||
| AMC 8 | Very Easy | Show TagsPrime Factorization, Sum of Prime Factors | ||||
| AMC 8 | Easy | Show TagsDifference of Squares, Divisibility | ||||
| AMC 8 | Normal | Show TagsLeast Common Multiple, Prime Factorization | ||||
| AMC 8 | Normal | Show TagsDivisibility Rules, Logic | ||||
| AMC 8 | Very Easy | Show TagsOrder of Operations | ||||
| AMC 8 | Very Easy | Show TagsEstimation, Scientific Notation | ||||
| AMC 8 | Easy | Show TagsArithmetic Series, Factorials | ||||
| AMC 8 | Easy | Show TagsDivisibility, Prime Factorization | ||||
| AMC 8 | Easy | Show TagsLeast Common Multiple, Modular Arithmetic | ||||
| AMC 8 | Hard | Show TagsFactoring, Legendre's Formula | ||||
| AMC 8 | Very Easy | Show TagsDivisibility Rules, Remainders | ||||
| AMC 8 | Easy | Show TagsDigit Optimization, Prime Factorization | ||||
| AMC 8 | Easy | Show TagsNumber of Divisors | ||||
| AMC 8 | Normal | Show TagsChinese Remainder Theorem | ||||
| AMC 8 | Very Easy | Show TagsFractions, Inequalities | ||||
| AMC 8 | Easy | Show TagsFractions, Percentages | ||||
| AMC 8 | Normal | Show TagsDigit Manipulation, Palindromes | ||||
| AMC 8 | Normal | Show TagsCalendars, Modular Arithmetic | ||||
| AMC 8 | Normal | Show TagsAlgebraic Setup, Percentages | ||||
| AMC 8 | Hard | Show TagsDiophantine Equations, Fractions, Logic | ||||
| AMC 8 | Easy | Show TagsAverages, Data Interpretation | ||||
| AMC 8 | Normal | Show TagsLogic, Overlapping Sets, Sums | ||||
| AMC 8 | Normal | Show TagsNumber of Divisors, Prime Factorization | ||||
| AMC 8 | Normal | Show TagsDigit Restrictions, Divisibility Rules | ||||
| AMC 8 | Normal | Show TagsAverages, Logic, Parity | ||||
| AMC 8 | Very Easy | Show TagsDiophantine, Prime Factorization | ||||
| AMC 8 | Normal | Show TagsFactorials, Modular Arithmetic, Units Digit | ||||
| AMC 8 | Very Easy | Show TagsOrder of Operations | ||||
| AMC 8 | Easy | Show TagsNumber Patterns, Primes | ||||
| AMC 8 | Easy | Show TagsExponents, Optimization | ||||
| AMC 8 | Very Easy | Show TagsSubtraction, Units Digit | ||||
| AMC 8 | Very Easy | Show TagsArithmetic Operations, Decimals, Fractions | ||||
| AMC 8 | Very Easy | Show TagsPerfect Squares, Sum of Consecutive Integers | ||||
| AMC 8 | Very Easy | Show TagsDice, Multiples, Sum and Product | ||||
| AMC 8 | Normal | Show TagsCryptarithm, Divisibility Rules | ||||
| AMC 8 | Normal | Show TagsDivisibility, Grid Coloring, Pigeonhole Principle | ||||
| AMC 8 | Normal | Show TagsData Representation, Histograms, Modular Arithmetic | ||||
| AMC 8 | Normal | Show TagsLogic, Pairing, Sums | ||||
| AMC 8 | Very Hard | Show TagsDifference of Squares, Number Properties, Prime Factorization | ||||
Module Progress:
Join the AoPS Community!
Stuck on a problem, or don't understand a module? Join the AoPS community and get help from other math contest students.
