Thandi's necklace
Thandi lives in Mpumalanga, South Africa. Her grandmother is an expert beadworker, and today she is teaching Thandi to make a necklace. "The best necklaces follow a pattern," says Gogo. Thandi threads the beads: red, blue, green, red, blue, green, red, blue, green, …
The necklace will have 100 beads. "What colour will the very last bead be?" asks Gogo.
Thandi doesn't want to thread 99 beads just to find out! Is there a way to predict it?
Patterns all around
Some patterns repeat the same part again and again.
- A clapping game: clap, clap, stamp, clap, clap, stamp, …
- The days of the week: Monday, Tuesday, …, Sunday, and then Monday again.
- In many places: wet season, dry season, wet season, dry season, …
Other patterns grow: each step changes by the same rule.
- Shoes: 1 child has 2 shoes, 2 children have 4 shoes, 3 children have 6 shoes, … Each new child adds 2 shoes.
- A staircase of blocks: 1 block, then 2, then 3, then 4, … Each step adds 1 block.
To continue a pattern, you need to know its rule: what repeats, or how it grows.
Make and predict patterns
Make a repeating pattern by changing the unit — the part that repeats. Then try to predict item number 20 before you look. "Show how" explains a clever shortcut, which grown-ups can find in "Why predicting works" below.
Repeat and predict
Find the part that repeats, or the rule that makes a pattern grow.
The core: the part that repeats
Tap a shape to add it to the core:
The pattern
- A1
- B2
- C3
- A4
- B5
- C6
- A7
- B8
- C9
- A10
- B11
- C12
What is item number 20?
Now switch to a growing pattern. Each figure has 2 more tiles than the one before: 2, 4, 6, … How many tiles will figure 10 have? Predict, then press "Reveal the rule".
A growing pattern
Find the part that repeats, or the rule that makes a pattern grow.
| Step | 1 | 2 | 3 | 10 |
|---|---|---|---|---|
| Tiles | 2 | 4 | 6 | ? |
| Change | +2 | +2 |
Patterns hide in the number grid too. Counting in twos lights up every other number. What shape do the lit-up squares make? Try counting in fives, then in tens.
Count in twos
Mark the multiples of a number and look for patterns. Add a second number to find common multiples.
- multiple of 2
There are 25 multiples of 2 from 1 to 50.
Tap a number to see how it is related.
Big ideas
Definition— repeating pattern
A repeating pattern is made by repeating the same part again and again. The part that repeats is called the unit.
Definition— growing pattern
A growing pattern changes by the same rule at each step, such as "add 2".
Definition— rule
The rule of a pattern says exactly how to make every item: which unit repeats, or what happens at each step. Once the rule is stated, every item of the pattern is decided.
Let's explore together
Example— Find the unit
Here is a pattern of shapes: ● ▲ ▲ ● ▲ ▲ ● ▲ ▲ …
The unit is ● ▲ ▲ — three items. It is not just ●, and it is not ● ▲: after ● ▲ comes another ▲, not another ●. The next item after the picture is ●, because a new unit begins.
Example— Predicting the 30th bead
In Thandi's necklace the unit is red, blue, green — 3 beads. So every third bead is green: beads 3, 6, 9, 12, … Count in threes: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30. Bead 30 is green!
Then bead 31 starts a new unit, so it is red, bead 32 is blue, and bead 33 is green again. We predicted bead 31 without threading 30 beads.
Example— The days of the week
Today is Monday. What day will it be in 7 days? The week has 7 days, so 7 days later it is Monday again. In 14 days — two whole weeks — it is Monday again too. And in 8 days? One week and one more day: Tuesday.
Example— Growing patterns and their rules
- 2, 4, 6, 8, … The rule is add 2. Next come 10 and 12.
- 5, 10, 15, 20, … The rule is add 5 — like counting fingers on hands. Next comes 25.
- 1, 3, 5, 7, … The rule is also add 2, but starting from 1. Next comes 9.
You can describe 2, 4, 6, 8, … in a second way: the 1st number is , the 2nd is , the 3rd is . So the 10th number is — no need to list them all!
Example— Same start, different rules
Nia and Diego both see the start of a pattern: 1, 2, 4, … What comes next?
Nia says 8: "Each number is double the one before." Diego says 7: "I add 1, then 2, then 3, then 4, …"
Who is right? Both! Each of them has a rule that fits 1, 2, 4. The first few items were not enough to decide the pattern. That is why a good pattern-maker always says the rule.
Why predicting works — and when it doesn't
Why predicting works. In Thandi's necklace, the unit has 3 beads. Each new unit starts with red, so the bead 3 places further on always has the same colour. Jump 3 beads, and you land on the same colour; jump 3 again, same colour again. So to find any bead, you only need to know where it sits inside its unit: first, second or third.
When it doesn't. A few items can never tell you the rule for sure. 1, 2, 4 could go on with 8 or with 7 — or with something else. Even a long start can fool you! Draw points on a circle and join every pair with straight lines. With 1, 2, 3, 4 and 5 points, the circle is cut into at most 1, 2, 4, 8 and 16 pieces — it looks exactly like doubling. But with 6 points, the most you can get is 31, not 32.
For grown-ups · the mathematics of patterns
A pattern is a function from positions to items. A repeating pattern with a unit of items is periodic: for every . Applying this times gives (induction on ). Dividing by with remainder, with , gives , where position behaves like position (the last item of the unit). For the necklace, , so bead 100 matches bead 1: red. This is the beginning of modular arithmetic.
A growing pattern given by a step rule, and , and one given by a formula, , are the same pattern: they agree at , and if they agree at they agree at — a proof by induction. Formulas like "the -th term is " are children's first algebraic expressions.
No finite list of first terms determines a sequence: any finite start can be continued in infinitely many ways (for example, for any numbers and any next value , there is a polynomial of degree at most with for and ). The circle example is Moser's circle problem: with points in general position the number of regions is , which gives . Philosophers have discussed the same issue: Ludwig Wittgenstein's Philosophical Investigations (1953) imagines a pupil who, told to "add 2", writes 1000, 1004, 1008, … and insists he is going on in the same way.
Gideon's true-or-false game
Gideon looks at Thandi's necklace: red, blue, green, red, blue, green, … True or false?
- "Bead 4 and bead 7 are the same colour." — True. They are 3 beads apart, and the unit has 3 beads. Both are red.
- "The unit of the necklace is one red bead." — False. The unit is red, blue, green. After red comes blue, not red.
- "1, 2, 4, … must continue with 8." — False! Diego's rule continues with 7.
- "In the pattern 2, 4, 6, 8, …, adding 2 each time, the 10th number is 20." — True. The -th number is .
For grown-ups · patterns, checked by Lean
In Lean, a pattern is a function that gives the item at each position. Here is Thandi's necklace; the bead at position is decided by a remainder:
/-- Thandi's necklace: red, blue, green, red, blue, green, … The bead at position `n` (counting
from 1) depends on the remainder when `n + 2` is divided by 3, so bead 1 is red, bead 2 blue
and bead 3 green. -/
def bead (n : Nat) : Colour :=
match (n + 2) % 3 with
| 0 => .red
| 1 => .blue
| _ => .green/-- The first six beads are red, blue, green, red, blue, green. -/
theorem first_beads :
[bead 1, bead 2, bead 3, bead 4, bead 5, bead 6] = [.red, .blue, .green, .red, .blue, .green] :=
rflThe key fact: the bead 3 places further on always has the same colour. And the unit really is three beads, not one or two:
/-- **Three places on, the same colour.** The unit red–blue–green has 3 beads, so the bead 3 places
further on always has the same colour: adding 3 does not change the remainder on division by 3. -/
theorem bead_repeats (n : Nat) : bead (n + 3) = bead n := by
have h : (n + 3 + 2) % 3 = (n + 2) % 3 := by
rw [Nat.add_right_comm, Nat.add_mod_right]
unfold bead
rw [h]/-- The unit is not a single bead: the pattern does *not* repeat after 1 place or after 2 places
(bead 2 differs from bead 1, and bead 3 differs from bead 1). -/
theorem unit_is_not_one_bead : bead 2 ≠ bead 1 ∧ bead 3 ≠ bead 1 := by decideNow for any repeating pattern, of anything at all: if it repeats with a unit of items, the item at position is the item at position . That is how we predict without drawing every step — and Lean uses it to find the 100th bead.
/-- A pattern `p` **repeats with a unit of `k` items** when the item `k` places further on is
always the same as the item here. -/
def Repeats {α : Type} (p : Nat → α) (k : Nat) : Prop := ∀ n, p (n + k) = p n/-- **Predicting without drawing every item.** In a pattern that repeats with a unit of `k` items,
the item at position `n` is the same as the item at position `n % k` (the remainder when `n`
is divided by `k`): write `n = (n % k) + k × (n / k)` and use `repeats_many`. -/
theorem predict {α : Type} {p : Nat → α} {k : Nat} (h : Repeats p k) (n : Nat) :
p n = p (n % k) := by
calc p n = p (n % k + k * (n / k)) := by rw [Nat.mod_add_div]
_ = p (n % k) := repeats_many h (n / k) (n % k)/-- The 100th bead is red. Since `100 = 3 × 33 + 1`, the 100th bead is the same as the 1st. -/
theorem bead_hundred : bead 100 = .red :=
calc bead 100 = bead (100 % 3) := predict bead_repeats 100
_ = .red := rfl"Add 2 each time" and "2 × the step number" are two different definitions — and Lean proves they describe the same growing pattern:
/-- The growing pattern 2, 4, 6, 8, … described by its step rule: start at 0 before step 1, and
add 2 at each step. -/
def addTwo : Nat → Nat
| 0 => 0
| n + 1 => addTwo n + 2/-- The same pattern described by a rule for the `n`-th item: `2 × n`. -/
def twice (n : Nat) : Nat := 2 * n/-- **Two descriptions, one pattern.** "Add 2 each time" and "2 × the step number" give the same
item at every step. Proof by induction: both start at 0, and both grow by 2 at each step. -/
theorem addTwo_eq_twice (n : Nat) : addTwo n = twice n := by
induction n with
| zero => rfl
| succ k ih =>
calc addTwo (k + 1) = addTwo k + 2 := rfl
_ = twice k + 2 := by rw [ih]
_ = twice (k + 1) := (Nat.mul_succ 2 k).symmFinally, Nia's and Diego's rules agree on 1, 2, 4 and then differ — and, more generally, no finite start ever decides a pattern:
/-- **1, 2, 4 — and then?** The doubling rule and the add-more rule agree on the first three
items, 1, 2, 4, but the fourth item is 8 for one and 7 for the other. -/
theorem same_start_different_rules :
[doubling 1, doubling 2, doubling 3] = [addMore 1, addMore 2, addMore 3] ∧
doubling 4 = 8 ∧ addMore 4 = 7 := by
decide/-- **No finite start decides a pattern.** Whatever list of first items `start` you are given,
there are two rules `f` and `g` that agree on all of them but give different next items. (Take
`f` to continue the list with 0s, and `g` to be the same except one bigger at the next place.) -/
theorem start_never_decides (start : List Nat) :
∃ f g : Nat → Nat, (∀ i, i < start.length → f i = g i) ∧ f start.length ≠ g start.length := by
refine ⟨fun i => start.getD i 0,
fun i => if i = start.length then start.getD i 0 + 1 else start.getD i 0, ?_, ?_⟩
· intro i hi
have hne : i ≠ start.length := Nat.ne_of_lt hi
simp [hne]
· simpMathlib calls such patterns Function.Periodic, and its Function.Periodic.map_mod_nat is the library version of predict. The circle-region numbers are not formalised here.
Margaret tests the shortcut
For grown-ups · Margaret's program
Press Run to try it in your browser. Checking 1,000 beads is evidence for those 1,000 beads; the reason in "Why predicting works" (proved in Lean above) covers every bead. The circle-region numbers are computed from Moser's formula, which the program evaluates but does not prove.
"""Predicting patterns: remainders, growing rules, and patterns that fool us.
A repeating pattern such as red, blue, green, red, blue, green, ... is
decided by its unit. To find the 100th bead we need not draw 100 beads: the
remainder when 100 is divided by 3 tells us. We check this shortcut against
drawing every bead, find the length of the repeating unit, compare two
descriptions of the growing pattern 2, 4, 6, 8, ..., and finally show three
different rules that all begin 1, 2, 4 but then go their own ways - one of
them (regions of a circle) looks like doubling for five items and then
breaks the pattern.
The checks are exact and cover the first 1,000 positions (or 50 steps).
The circle-region counts come from a formula proved in combinatorics; this
program only evaluates it.
Runs unchanged in the browser (Pyodide) using only the standard library.
"""
from math import comb
import textwrap
UNIT = ("red", "blue", "green")
def item(unit, n):
"""Item n (counting from 1) of the pattern that repeats ``unit``."""
if n < 1:
raise ValueError("positions start at 1")
return unit[(n - 1) % len(unit)]
def draw(unit, count):
"""List the first ``count`` items by repeating the unit again and again."""
items = []
while len(items) < count:
items.extend(unit)
return items[:count]
def smallest_unit_length(items):
"""Smallest k such that every item equals the item k places further on."""
for k in range(1, len(items) + 1):
if all(items[i] == items[i + k] for i in range(len(items) - k)):
return k
return len(items)
def add_two(steps):
"""The growing pattern 'start at 2 and add 2 each time', as a list."""
values, value = [], 0
for _ in range(steps):
value += 2
values.append(value)
return values
def doubling(n):
"""1, 2, 4, 8, ...: each item is double the one before."""
return 2 ** (n - 1)
def add_more(n):
"""1, 2, 4, 7, 11, ...: add 1, then 2, then 3, and so on."""
return 1 + (n - 1) * n // 2
def circle_regions(n):
"""Most regions a circle is cut into by joining n points on it.
The formula C(n, 4) + C(n, 2) + 1 is a theorem of combinatorics
(Moser's circle problem); here it is only evaluated.
"""
return comb(n, 4) + comb(n, 2) + 1
def main():
first = draw(UNIT, 12)
print("Repeating pattern, unit red-blue-green:")
print(" " + " ".join(colour[0].upper() for colour in first) + " ...")
q, r = divmod(100, len(UNIT))
print(f" item 100: 100 = 3 x {q} + {r}, so it matches item "
f"{r or len(UNIT)}: {item(UNIT, 100)}")
drawn = draw(UNIT, 1000)
agree = sum(item(UNIT, n) == drawn[n - 1] for n in range(1, 1001))
print(f" remainder shortcut agrees with drawing every bead: "
f"{agree} of 1000")
same = sum(item(UNIT, n + 3) == item(UNIT, n) for n in range(1, 1001))
print(f" item n + 3 equals item n for {same} of 1000 positions")
print(f" smallest repeating unit: {smallest_unit_length(drawn[:60])} "
"items (not 1)")
print()
steps = add_two(50)
match = sum(v == 2 * n for n, v in enumerate(steps, start=1))
print("Growing pattern 2, 4, 6, 8, ...:")
print(f" 'add 2 each time' equals '2 x step' for {match} of 50 steps")
print()
print("Three rules that all start 1, 2, 4:")
rules = [("doubling", doubling), ("add 1, 2, 3, ...", add_more),
("circle regions", circle_regions)]
for name, rule in rules:
values = ", ".join(str(rule(n)) for n in range(1, 8))
print(f" {name:<17} {values}, ...")
print(" Circle regions look like doubling for five items, then: 31!")
print()
print(textwrap.fill(
"Epistemic status: exact checks of the first 1,000 positions and 50 "
"steps, which is evidence, not a proof, for later positions (the "
"lesson gives the proof). The three rules are a counterexample to "
"'the first few items decide a pattern'; the circle-region numbers "
"come from a known formula that this program evaluates but does not "
"prove.",
width=78,
))
if __name__ == "__main__":
main()Your turn
Say the pattern out loud, clap it, or draw it — whatever helps. Hints are there when you want them.
1. Patterns
Warm-upHumanWhat comes next? ● ■ ● ■ ● ■ ● ___
2. Patterns
CoreHumanHere is a repeating pattern: 🍎 🍌 🍌 🍎 🍌 🍌 🍎 🍌 🍌 … What is its unit — the part that repeats?
3. Patterns
Warm-upHumanWhat number comes next? 2, 4, 6, 8, ___
4. Patterns
CoreHumanThe pattern 5, 10, 15, 20, … adds 5 each time. What is the 6th number in the pattern?
5. Patterns
CoreHumanThandi's necklace goes red, blue, green, red, blue, green, … What colour is bead 20?
6. Patterns
CoreHumanToday is Wednesday. What day of the week will it be in 14 days?
7. Patterns
StretchHumanA clapping game goes: clap, clap, stamp, clap, clap, stamp, … In the first 12 moves, how many claps are there?
8. Patterns
StretchHumanA pattern starts 1, 2, 4, … Nia says the next number is 8. Diego says it is 7. Who could be right?
9. Patterns
StretchFormalGideon's game: true or false? "In any repeating pattern whose unit has 4 items, item 5 and item 9 are the same."
10. Patterns
StretchComputationalMargaret's computer checked the remainder shortcut for beads 1 to 1,000 and found no mistakes. Can we be sure the shortcut works for bead 5,000 too?
Things that trip people up
Misconception
"A pattern must go on the way I first guessed." The first few items don't decide a pattern. 1, 2, 4 might continue with 8 or with 7. Always say your rule, and ask other people for theirs.
Misconception
"The unit is the first thing in the pattern." The unit is the whole part that repeats. In ● ▲ ▲ ● ▲ ▲, the unit is ● ▲ ▲ — three items — not just ●.
Misconception
"After the last item I can see, the pattern starts again." Only if you have reached the end of a unit. In ● ▲ ▲ ● ▲, the next item is ▲, because the second unit is not finished yet.
Misconception
"Growing patterns always add the same number." Many do, like 2, 4, 6, 8. But some grow in other ways: doubling gives 1, 2, 4, 8, 16, and adding one more each time gives 1, 2, 4, 7, 11. The rule tells you which.
For grown-ups: other ways of seeing
Number theory— Remainders and interlocking cycles
The item of a repeating pattern depends only on the position modulo the length of the unit. Two repeating patterns running side by side return to their starting combination after the least common multiple of their unit lengths. The Maya tzolk'in combines 13 day numbers with 20 day names into a cycle of days. The traditional Chinese calendar combines 10 heavenly stems with 12 earthly branches into a cycle of years — not 120, because only half of the 120 possible pairs ever occur. See clock arithmetic.
Geometry— A pattern is a symmetry
A repeating strip pattern, such as a beaded band or a woven border, looks exactly the same after a slide (translation) by one unit: the pattern is invariant under a group of translations. Adding reflections, half-turns and glide reflections, mathematicians have proved that there are exactly seven types of symmetry for infinite strip patterns — the seven frieze groups — and all seven appear in textiles, pottery and architecture from many cultures. See symmetry: slides, turns and flips.
Logic— Seeing a pattern is not proving it
Guessing a rule from examples is induction in the everyday sense, and it can fail, as Moser's circle shows. Mathematics turns a guess into knowledge by stating the rule and then proving facts about it — often by mathematical induction, as in the Lean proofs above. See proof techniques.
Wonder further
A clock is a repeating pattern: after 12 hours, the hands are back where they started. What time will it be in 29 hours? This trail is for older brothers and sisters — and curious grown-ups. It is completely optional.
Wonder Trail · Optional · never gradedClock arithmeticIt's 9 o'clock. What time will it be in 5 hours — and in 29 hours? Can a clock teach us a whole new kind of arithmetic?Follow the trailPatterns around the world
- Kente cloth, woven by Asante and Ewe weavers in Ghana and Togo, is made of narrow strips whose woven designs repeat along their length; each design has its own name.
- Ndebele artists in South Africa are famous for bold repeating patterns in beadwork and on painted house walls.
- Weavers in the Andes have made textiles with intricate repeating bands for thousands of years.
- Calendars are patterns in time. The Maya tzolk'in repeats every 260 days, and the traditional Chinese calendar names years in a 60-year cycle, including the repeating 12 animals of the zodiac. The seven-day week, used around the world today, is very old.
- The English mathematician G. H. Hardy wrote in A Mathematician's Apology (1940): "A mathematician, like a painter or a poet, is a maker of patterns."
- Today, the On-Line Encyclopedia of Integer Sequences, founded by Neil Sloane, collects hundreds of thousands of number patterns — including several different ones that begin 1, 2, 4.
For grown-ups: further reading
- Keith Devlin, Mathematics: The Science of Patterns (1994).
- Paulus Gerdes, Geometry from Africa: Mathematical and Educational Explorations (1999).
- Dorothy K. Washburn and Donald W. Crowe, Symmetries of Culture: Theory and Practice of Plane Pattern Analysis (1988) — frieze and wallpaper patterns in textiles and pottery around the world.
- Ian Stewart, Nature's Numbers (1995).
Optional Christian reflection · seedtime and harvest
A reflection from the Christian tradition that inspires The Lumenary. It is not part of the mathematics and you are welcome to skip it.
After the flood in the book of Genesis, God promises that "while the earth remaineth, seedtime and harvest, and cold and heat, and summer and winter, and day and night shall not cease" (Genesis 8:22, King James Version). Many people of faith see the reliable rhythms of the world — day and night, the seasons, the turning year — as a gift that makes planning, planting and learning possible. The mathematics of patterns does not depend on this reflection; it is offered only as one way of wondering at the order we find.