Interactive Course

Number Theory

Explore the powers of divisibility, modular arithmetic, and infinity.



This course starts at the very beginning — covering all of the essential tools and concepts in number theory, and then applying them to computational art, cryptography (code-breaking), challenging logic puzzles, understanding infinity, and more!

Topics covered

  • Divisibility Shortcuts
  • Exploring Infinity
  • Factor Trees
  • Fermat's Little Theorem
  • Greatest Common Divisor
  • Least Common Multiple
  • Modular Arithmetic
  • Modular Congruence
  • Modular Inverses
  • Prime Factorization
  • The 100 Doors Puzzle
  • Totients

Interactive quizzes


Concepts and exercises


Course map

Prerequisites and Next Steps

  1. 1


    In these warmups, if you know the trick, you'll finish each problem in seconds!

    1. Last Digits

      Use shortcuts to find just the last digit of each answer – there's no need to calculate the rest!

    2. Secret Messages

      Look for patterns, and when you think you've found one, use it to decode the message!

    3. Rainbow Cycles

      Investigate the coloring rules that apply when you do math on a rainbow-striped number grid.

  2. 2


    Every integer greater than 1 has a unique name that can be written down in primes.

    1. Divisibility Shortcuts (I)

      How much can you learn about a number if you can only see its last digit?

    2. Divisibility Shortcuts (II)

      Review the divisibility shortcuts that apply when you're dividing by a power of 2 or 5.

    3. Divisibility by 9 and 3

      Explore the pattern of what remainders remain when you divide powers of 10 by 9 or 3.

    4. Last Digits

      Apply divisibility rules as well your own logic to determine just the last digit of each solution.

    5. Arithmetic with Remainders

      How do the remainders of an operation's inputs impact the remainder of the calculation output?

    6. Digital Roots

      Investigate surprising patterns that surface when you calculate digital roots.

    7. Factor Trees

      Factor each number one step at a time until every piece that you have is a prime.

    8. Prime Factorization

      Learn to use factorization as a versatile problem-solving tool.

    9. Factoring Factorials

      Since they're defined as products, what happens when you factor them?

    10. Counting Divisors

      Learn a quick technique for determining how many different divisors a number has.

    11. 100 Doors

      Imagine a long hallway with 100 closed doors numbered 1 to 100...

    12. How Many Prime Numbers Are There?

      Are there finitely many prime numbers or infinitely many of them, and how can you be sure either way?

  3. 3

    GCD and LCM

    Explore, apply, and relate the GCD and LCM.

    1. 100 Doors Revisited

      Again, imagine that long hallway of doors, but this time focus your attention on exactly who does what.

    2. The LCM

      Build intuition for where least common multiples appear in both abstract and real-life contexts.

    3. Billiard Tables

      Explore how the path of a ball bouncing around a pool table is affected by the table's dimensions.

    4. The GCD

      Use prime factorization as a tool for finding the greatest common divisors of pairs of numbers.

    5. Dots on the Diagonal

      When you draw a right triangle on a grid of dots, how many dots does does the hypotenuse cut through?

    6. Number Jumping (I)

      When do these jumping rules allow you to reach every number on the number line?

    7. Number Jumping (II)

      Develop a systematic procedure to determine the smallest positive integer that you can reach by jumps.

    8. Number Jumping (III)

      What's the pattern to these answers? What's going on in the big picture here?

    9. Relating LCM and GCD

      Understand how the GCD and LCM are related by thinking about factors arranged in a Venn diagram.

    10. Billiard Tables Revisited (I)

      Explore the patterns created when pool balls "paint" the squares they touch as they roll.

    11. Billiard Tables Revisited (II)

      How do you get back "home" to the bottom left pocket?

  4. 4

    Modular Arithmetic (I)

    The danger of cyclic systems: one step too far and you're back where you started!

    1. Times and Dates

      Time, as measured by a clock or calendar, is "modular," so let's start there...

    2. Modular Congruence

      What happens when you wrap an infinite number line around a one-unit square?

    3. Modular Arithmetic

      Learn and practice doing arithmetic in the modular world.

    4. Divisibility by 11

      Review the rules for arithmetic with remainders and uncover the peculiar divisibility rule for 11.

    5. Star Drawing (I)

      You probably know how to draw a 5-pointed star, but what about an 8 or 12 or 30-pointed star?

    6. Star Drawing (II)

      Learn a general formula for the number of points a star will have.

    7. Star Drawing (III)

      How many different 60-point stars can you make, drawing just one path on a circle of 60 points?

    8. Die Hard Decanting (I)

      The challenge is to measure out a specific quantity of liquid using only a few types of legal moves.

    9. Die Hard Decanting (II)

      Which pairs of containers can measure out any quantity of liquid and which ones have limited use?

  5. 5

    Modular Arithmetic (II)

    Considering the remainder "modulo" an integer is a powerful tool with many applications!

    1. Additive Cycles

      Explore a concept that's lurking beneath the surface of both star drawing and decanting puzzles.

    2. Modular Multiplicative Inverses

      Can normal equations with no integer solutions be converted into congruences that DO have solutions?

    3. Multiplicative Cycles

      What does exponentiation look like in modular arithmetic?

    4. Fermat's Little Theorem

      Use the factorization of a number to determine how many small numbers are relatively prime to it.

    5. Totients

      This isn't Fermat's fearsome Last Theorem, but it still packs a big punch for a little guy!

    6. Last Digits Revisited

      Use Euler's theorem to quickly find just the last few digits of enormous exponential towers!

    7. Perfect Shuffling

      Leverage what you know about totients to find any card in the deck after a series of perfect shuffles.

  6. 6

    Exploring Infinity

    Explore one of the most misunderstood concepts in math - infinity.

    1. Counting to Infinity

      To understand cardinal infinity, first start by counting and comparing finite sets.

    2. Multiple Infinities

      Explore a crazy world of numbers that contains infinitely many infinities, both small and large.

    3. Hilbert's Hotel

      Help Hilbert use his hotel that has infinitely many rooms to host infinitely many sleepy guests.

    4. Infinitely Large

      Can a betting game have an infinite expected value?

  7. 7

    Coming soon