Count Digit Patterns by Position, Equality, and Difference
Label the digit positions, classify their relationships, protect the leading digit, and count each pattern exactly once.
Place valueExact repetitionEdge casesPalindromes
Progress is saved in this browser.
Pattern-first counting
Count relationships before assigning values
A numeral is a row of labeled positions. A good classification first decides which positions are related, then counts the digits that may occupy those positions.
1. Label Thousands, hundreds, tens, ones.
2. Classify Equal, different, greater, or a fixed distance apart.
3. Audit No leading zero, no overlap, and no omitted case.
1
Foundation
Read a numeral as labeled positions
Not complete
Read the notation in words
|a − d| = 2 means “the larger of a and d minus the smaller equals 2.” For a four-digit number abcd, a cannot be zero.
Digit-pattern scanner
4positions
3distinct digits
6first–last gap
Nopalindrome
Relationship report
Equality signature: ABBC
Exactly one pair is repeated.
The first digit of a multi-digit numeral cannot be zero. Later positions may use zero unless another rule forbids it.
Checkpoint
Need a hint?
The first digit cannot be zero. For the end-digit difference, subtract the smaller from the larger.
2
Worked example 2
Separate edge first digits from middle first digits
Not complete
Why multiply the choices?
After fixing the two end digits, count choices for each remaining position in turn. P(8,3) means 8 × 7 × 6: eight choices, then seven unused digits, then six. Order matters because the positions differ. A factorial such as 5! means 5 × 4 × 3 × 2 × 1.
Count four-digit numbers with four different digits whose thousands digit and units digit differ by 2.
Explore one thousands digit
1
Allowed units digits
After choosing the two endpoint digits, eight digits remain for the hundreds place and seven for the tens place.
Complete endpoint table
Thousands a
Units d with |a-d|=2
Case
Pairs
3edge endpoint pairs
12middle endpoint pairs
15endpoint pairs total
840four-digit numerals
(3×1+6×2)×8×7=15×56=840
Checkpoint
Need a hint?
Fix the end digits first. Count choices for the unfilled positions after removing digits already used.
3
Added counting laboratory
Generalize fixed endpoint differences
Not complete
Endpoint drawers
Count after endpoints
15endpoint pairs
56middle fillings
840total numerals
2middle positions
First generated examples
Challenge checkpoint — 5 digits, difference 3, all digits different
Need a hint?
Separate the end-digit cases containing zero: the leading position has a different restriction.
4
Guided Practice 1
Count exactly one repeated pair in three positions
Not complete
For exactly one repeated pair, choose which digit repeats, which two positions it occupies, and the other different digits. Keep the leading-zero case separate: a zero in the first position does not make a three-digit number. Do not include a triple or two pairs.
Case convention: the two equal positions form exactly one pair, and the third digit is different. Numerals such as 777 are not included.
Pattern AAB
Classify a numeral
81AAB
81ABA
81BAA
243total
81+81+81=243
Checkpoint
Need a hint?
Exactly one pair excludes a triple and excludes two different repeated pairs.
5
Practice transfer
Count a repeated pair when the first digit is fixed
Not complete
Count four-digit numerals beginning with 1 that contain exactly one repeated pair: one digit appears twice and two other, different digits appear once each. The worked examples are 1337, 1558, and 1371.
Why every pattern contributes 72
Choose one digit in 9 ways and a different remaining digit in 8 ways:
9×8=72
There are three positions where the fixed digit 1 may repeat, and three positions for a repeated digit other than 1.
Pattern validator
3patterns repeating 1
3patterns repeating another digit
72per pattern
432total
6×72=432
Checkpoint
Need a hint?
Separate the case where the leading 1 is repeated from the case where another digit repeats.
6
Practice transfer
Build an inequality staircase for two-digit numbers
Not complete
Classify by the tens digit
Why the staircase is not symmetric
The tens digit may be 1 through 9, but never 0. The ones digit may be 0 through 9.
1+2+3+⋯+9=45
45numerals
9largest case
1smallest nonzero case
90all two-digit numerals
Checkpoint for tens digit > ones digit
Need a hint?
For tens digit t, there are t smaller possible ones digits. A larger ones digit must also stay at most 9.
7
Guided Practice 5
Split a bounded range at complete hundred-blocks
Not complete
Count integers from 1985 through 4891 whose tens digit equals their units digit.
1985–1999 2 matches
19881999
2000–4799 28×10=280
Twenty-eight complete hundred-blocks; each contains suffixes 00, 11, …, 99.
4800–4891 9 matches
2+280+9=291
General ending-twins laboratory (both endpoints included)
Range result
For this laboratory, use two places for numbers below 10: 0 is written 00 and qualifies; 1–9 do not qualify. Reversed endpoints are not allowed.
291matching integers
1988first match
4888last match
30hundred-blocks touched
Checkpoint
Need a hint?
Split the interval into a first fragment, complete hundred-blocks, and a final fragment.
8
Exercise 11
Count palindromes by their independent half
Not complete
A nonzero natural number is a palindrome when it reads the same forward and backward. A palindrome is determined by its first half, including the middle digit when its length is odd.
Counts from one through six digits
Digits
Independent positions
Count
Cumulative
Mirror a first half
997
↔
997799
Find a palindrome by its rank
The 1996th palindrome is 997799.
Neighborhood in the ordered list
There are 1098 palindromes with at most five digits. Rank 1996 is therefore the 898th six-digit palindrome.
1098through 5 digits
900exactly 6 digits
1998through 6 digits
9977991996th value
Checkpoint
Need a hint?
Only the first half is freely chosen; reflecting it determines the rest. Odd length shares the middle digit.
9
Independent practice
Digit-pattern workshop
Not complete
Correct all eight questions to complete the workshop.
1. Which position cannot contain 0 in a four-digit numeral?
2. How many ordered (thousands, units) digit pairs have absolute difference 2, with a nonzero thousands digit?
3. How many four-digit numerals have all digits different and absolute difference 2 between their first and last digits?
4. Three-digit numerals with exactly one repeated pair?
5. Four-digit numerals beginning with 1 and exactly one repeated pair?
6. Two-digit numerals with tens digit greater than ones digit?
7. How many integers from 1985 through 4891 inclusive have equal tens and units digits?
8. Positive palindromes with one through six digits?
Need a hint?
Answers: thousands; 15; 840; 243; 432; 45; 291; 1998. For paired digits, count equality-position patterns first. For the interval, count 2+280+9. For palindromes, add 9+9+90+90+900+900.
10
Objective assessment
Exit ticket and certificate
Not complete
Earn 5 out of 5. The certificate also requires Missions 1–9 to be complete.
1. How many five-digit numerals have all digits different and an absolute difference of 3 between their first and last digits?
2. Equality-position patterns for exactly one pair in three digits?
3. Integers from 1 through 999 whose final two digits match?
4. Positive palindromes with exactly five digits?
5. What is the 1996th positive palindrome?
Need a hint?
Answers: 4368; 3; 99; 900; 997799. The five-digit count is 13×8×7×6. The three pair patterns are AAB, ABA, BAA. From 1–999 there are nine matches in 1–99 and ten in each of the next nine hundred-blocks. Five-digit palindromes have 9×10×10 choices. Rank 1996 follows 1098 shorter palindromes; prefix 100+898−1=997 gives 997799.
Chapter 24 · Classification
Digit-Pattern Classification Architect
This certifies that the learner can count numeral patterns by position, exact equality, digit difference, and mirrored structure.