Lesson 4 of 6 · Mixed Problem Solving
Pattern Discovery & Testing Small Cases
When a problem's general structure isn't obvious, the fastest way in is often the least clever one: compute n=1, n=2, n=3 by hand, write down what happens, and look for the pattern — then check it holds, rather than trusting it outright.
Mark your status for this lesson:
Learning objectives
- Discover a units-digit or modular-exponentiation cycle by computing several terms directly.
- Recognize and apply closed-form sums: triangular numbers, sums of squares, sums of cubes.
- Compute recursive sequences term by term when no closed form is needed.
- Verify a discovered pattern is general, rather than trusting a coincidence from too few cases.
The core idea
Testing small cases is a discovery tool, not a proof technique on its own — computing n=1, 2, 3 (and often 4, to be safe) reveals a candidate pattern, which then needs either a closed-form justification (a known formula, or an algebraic derivation) or enough additional cases to be confident it's not a coincidence. A pattern that holds for three small cases is a hypothesis, not a conclusion.
Several patterns recur often enough to be worth recognizing on sight rather than re-deriving: units digits of powers cycle with a short period (usually 1, 2, or 4), and several sums have closed forms — triangular numbers (n(n+1)/2), sums of squares (n(n+1)(2n+1)/6), and sums of cubes (equal to the square of the sum of the first n integers, a genuinely striking identity). Recognizing these instantly saves the trouble of rediscovering them from scratch each time.
Closed-form sums worth recognizing
Triangular: n(n+1)/2 Squares: n(n+1)(2n+1)/6 Cubes: [n(n+1)/2]²
These are the sums 1+2+⋯+n, 1²+2²+⋯+n² and 1³+2³+⋯+n³. The sum-of-cubes identity is especially worth remembering — the sum of the first n cubes always equals the square of the sum of the first n integers.
Why “triangular”
Stack rows of 1, 2, …, n dots and you get a triangle. A second copy, turned upside down, fits against it to make a rectangle of n rows and n+1 columns. So two triangles hold n(n+1) dots, and one holds n(n+1)/2.
Why the cubes make a square
Draw a square whose side is 1+2+⋯+n. Peel it into L-shaped bands: the band of thickness k has area k³, so the bands have areas 1³, 2³, …, n³, and together they fill the square. Its area is the square of the side, which is the triangular number squared.
Squares
The formula for 1²+⋯+n² is worth memorizing as stated. In the spirit of this lesson, it can also be checked: compare it with the sums built by hand for the first few values of n.
Using them
- Rewrite the sum so that it starts at 1 and runs to n.
- Pick the matching formula and substitute n.
- Sanity-check with a small case before trusting the result.
Pitfall. A sum that starts at k instead of 1 is the full sum minus the first k-1 terms: ∑ i from k to n = n(n+1)/2 − (k−1)k/2. Forgetting to subtract is the usual slip.
Cycle length for units digits and modular powers
Units digits of powers of a fixed base cycle with period dividing 4 (often exactly 1, 2, or 4); remainders mod other numbers cycle too, though the period varies — always compute enough terms to actually see where the cycle repeats before assuming a period.
Worked example 1 — Discovering a pattern from small cases
Problem
Find a closed-form expression for 1 + 3 + 5 + ... + (2n−1), the sum of the first n odd numbers.
Key insight
Compute the sum for n=1, 2, 3, 4 directly and look at the results before trying to derive anything algebraically.
Solution
n=1: sum=1. n=2: sum=4. n=3: sum=9. n=4: sum=16. These are exactly 1², 2², 3², 4² — the pattern is n².
Takeaway
Four small cases lining up with n² is strong evidence, but not proof — a full proof would pair the first and last terms, the second and second-to-last, and so on, showing each pair sums to the same value. On a timed test, though, four confirming cases is usually enough to proceed confidently.
Worked example 2 — A units-digit cycle
Problem
What is the units digit of 9⁴⁷?
Key insight
Compute the first few powers of 9 directly to find the cycle before jumping to a large exponent.
Solution
9¹=9, 9²=81, 9³=729, 9⁴=6561 — units digits cycle as 9, 1, 9, 1, ... with period 2. Since 47 is odd, the units digit matches 9¹: 9.
Takeaway
Not every base has a period-4 cycle — 9 has period 2, and some bases (like those ending in 0, 1, 5, or 6) have period 1. Always verify the actual cycle length for the specific base rather than assuming period 4 by default.
Worked example 3 — A pattern that needs more than three cases
Problem
Consider n² − n + 41. Compute this for n=1, 2, 3. Does it look like it's always prime? Test n=41 to check.
Key insight
This is a famous cautionary example — the expression is prime for every integer from n=1 to n=40, which is far more confirming cases than most problems ever require, and yet the pattern still breaks.
Solution
n=1: 41 (prime). n=2: 43 (prime). n=3: 47 (prime). At n=41: 41² − 41 + 41 = 41², which is not prime (it's 41 squared).
Takeaway
This is an extreme example, but the lesson is real: testing small cases is for discovering a plausible pattern, not proving it — always look for a reason the pattern should hold, especially for a claim as strong as "always prime," rather than trusting volume of evidence alone.
Worked example 4 — Sum of cubes identity
Problem
Find 1³ + 2³ + 3³ + 4³ + 5³.
Key insight
The sum of the first n cubes always equals the square of the sum of the first n integers — no need to add the cubes individually.
Solution
Sum of 1 through 5: 15. 15² = 225.
Takeaway
Verify this identity once by hand for a small case (1³+2³+3³=36=6², matching 1+2+3=6) so it's trusted, then use it directly whenever a sum of consecutive cubes appears — recomputing cube by cube every time is unnecessary once the identity is known.
Strategy notes
Compute at least one more case than feels necessary
Two or three small cases can accidentally match a pattern that isn't actually general — computing one extra case beyond what seems needed is cheap insurance against a false pattern.
Look for a reason the pattern holds, not just that it does
Once a pattern is spotted, briefly ask why it should be true — even an informal argument (pairing terms, a recursive structure) is much stronger evidence than matching cases alone, and often reveals the pattern's exact boundary of validity.
Common mistakes
Assuming every units-digit cycle has period 4
Cycle length depends on the specific base — some have period 1 (bases ending in 0, 1, 5, 6), some period 2 (like 9 or 4), and some period 4 — always compute enough terms to see the actual cycle before assuming its length.
Trusting a pattern from too few cases
Especially for strong claims (always prime, always divisible by something), a handful of confirming cases is not proof — the n²−n+41 example shows a pattern can hold for dozens of cases and still break.
Misremembering which closed-form sum applies
The formulas for triangular numbers, sums of squares, and sums of cubes look superficially similar — double-check which one a problem actually calls for before applying it.
Practice
20 questions across four difficulty tiers, each with a single numeric answer. Up to three tries per question before the solution is shown.