Chapter

Digits, Bases and Periodicity

The module translates digit problems into congruences: divisibility rules, last digits, base-\(b\) notation, repunits, decimal periods, and first constructions of numbers with restricted digits.
Log in to track solved progress and bookmarks.

Theory

Key Idea

Digit problems are almost always congruence problems. A decimal representation is an expansion in powers of \(10\), and a representation in base \(b\) is an expansion in powers of \(b\). Thus divisibility rules, last digits, and decimal periods should be translated into residues.

The main move is this: if \(N=a_k10^k+\cdots+a_1 10+a_0\), then modulo \(m\) we may replace \(10\) by its residue. For example, modulo \(9\) we have \(10\equiv1\), modulo \(11\) we have \(10\equiv-1\), and the last \(r\) digits are determined by the residue modulo \(10^r\).

Basic Facts

  • If \(N=\overline{a_ka_{k-1}\ldots a_0}\), then \(N\equiv a_0+\cdots+a_k\pmod9\).
  • Modulo \(11\): \(N\equiv a_0-a_1+a_2-\cdots+(-1)^k a_k\pmod{11}\).
  • The last \(r\) digits of a number are its residue modulo \(10^r\).
  • In base \(b\): \((a_ka_{k-1}\ldots a_0)_b=a_kb^k+\cdots+a_1b+a_0\).
  • If \(\gcd(10,m)=1\), the period of \(\frac{1}{m}\) equals or divides the order of \(10\) modulo \(m\).
  • The repunit \(R_n=\underbrace{11\ldots1}_{n}=\frac{10^n-1}{9}\).

When to Use This Method

  • The problem mentions digits, digit sums, rearranged digits, or notation in another base.
  • You need the last one, two, or three digits of a power.
  • You need to prove divisibility of a number made of repeated digits.
  • A decimal fraction appears and the period length is required.
  • You need to construct a number with restricted digits divisible by a given \(m\).

How to Recognise the Method

If the problem mentions a sum of digits, try modulo \(9\) or \(3\). If an alternating digit sum, symmetry, or an even-length palindrome appears, check modulo \(11\). If last digits of a power are required, work modulo \(10^r\) and find the residue cycle.

If the statement contains a number of the form \(111\ldots111\), rewrite it as \(R_n=\frac{10^n-1}{9}\). Divisibility often becomes the condition \(10^n\equiv1\pmod m\).

Typical Mistakes

  • Using a divisibility rule as a slogan without naming the modulus behind it.
  • Forgetting the condition \(\gcd(10,m)=1\) when discussing decimal periods.
  • Claiming \(R_a\mid R_b\) is obvious; it should be connected to \(a\mid b\).
  • For last two digits, working only modulo \(25\) and forgetting to combine with modulo \(4\).
  • In base problems, forgetting that each digit must be smaller than the base.

Mini-Checklist

  • Which base is used: \(10\) or \(b\)?
  • Which modulus is natural: \(9\), \(11\), \(10^r\), \(b-1\), \(b+1\)?
  • Do we need a power cycle?
  • Can a number of ones be replaced by \(R_n=\frac{10^n-1}{9}\)?
  • Has the coprimality condition for a period been checked?
  • If a number with digits \(0\) and \(1\) is being constructed, can the pigeonhole principle be applied to residues?

Examples

Example 1. Digit Sum as a Congruence

A basic example: the divisibility rule for \(9\) is proved, not memorised.

Problem. Prove that a number \(N\) and the sum of its decimal digits have the same remainder modulo \(9\).

Solution.

Let \(N=a_k10^k+\cdots+a_1 10+a_0\). Since \(10\equiv1\pmod9\), we have \(10^i\equiv1\pmod9\) for all \(i\). Hence \(N\equiv a_k+\cdots+a_1+a_0\pmod9\).

Comment. This is why divisibility by \(9\) is tested by the digit sum.

Example 2. Alternating Sum

Modulo \(11\) appears because \(10\equiv-1\pmod{11}\).

Problem. Check whether \(583946\) is divisible by \(11\).

Solution.

Compute the alternating sum from the right: \(6-4+9-3+8-5=11\). It is divisible by \(11\), so \(583946\) is divisible by \(11\).

Comment. The signs must alternate consistently; direction affects only the sign of the final sum.

Example 3. Last Two Digits

The last two digits are the residue modulo \(100\).

Problem. Find the last two digits of \(7^{50}\).

Solution.

Since \(7^4=2401\equiv1\pmod{100}\), \(7^{50}=7^{4\cdot12+2}\equiv7^2\equiv49\pmod{100}\). The last two digits are \(49\).

Comment. The actual cycle is often shorter than Euler's theorem suggests.

Example 4. Base Notation

Translating into an expression in the base removes ambiguity.

Problem. Find all bases \(b>6\) for which \((253)_b\) is divisible by \(7\).

Solution.

We have \((253)_b=2b^2+5b+3\). Modulo \(7\), solve \(2b^2+5b+3\equiv0\). Checking residues \(b\pmod7\), we get \(b\equiv4\pmod7\). Since \(b>6\), all bases are \(b=7t+4\), \(t\ge1\).

Comment. Remember the base condition: all digits must be smaller than the base.

Example 5. Decimal Period

The period of \(\frac{1}{m}\) is linked to the order of \(10\) modulo \(m\).

Problem. Find the period length of \(\frac{1}{7}\).

Solution.

We need the least \(k>0\) such that \(10^k\equiv1\pmod7\). The residues are \(10\equiv3\), \(10^2\equiv2\), \(10^3\equiv6\), \(10^4\equiv4\), \(10^5\equiv5\), \(10^6\equiv1\pmod7\). Thus the period is \(6\).

Comment. This is not long division; it is a residue cycle.

Example 6. A Number of Ones

A repunit turns the problem into a congruence for a power of \(10\).

Problem. Prove that \(111111\) is divisible by \(7\), \(11\), and \(13\).

Solution.

We have \(111111=R_6=\frac{10^6-1}{9}\). Also \(1001=7\cdot11\cdot13\), and \(111111=111\cdot1001\). Hence the number is divisible by \(7\), \(11\), and \(13\).

Comment. Sometimes block factorisation is easier than direct work with a long decimal.

Example 7. All Repunit Lengths

The condition \(R_n\mid R_m\) is connected to divisibility of the indices.

Problem. Prove that if \(a\mid b\), then \(R_a\mid R_b\).

Solution.

Let \(b=qa\). Then \(R_b=1+10+\cdots+10^{b-1}\). Split the sum into blocks of length \(a\): \(R_b=R_a(1+10^a+10^{2a}+\cdots+10^{(q-1)a})\). Therefore \(R_a\mid R_b\).

Comment. The converse needs more work and is usually proved through the order of \(10\).

Example 8. A Number with Digits \(0\) and \(1\)

This is the first important example where the pigeonhole principle appears.

Problem. Prove that for every \(m\) coprime to \(10\), there exists a number consisting only of ones that is divisible by \(m\).

Solution.

Consider the \(m\) numbers \(R_1,R_2,\ldots,R_m\). If one is divisible by \(m\), we are done. Otherwise two have the same residue: \(R_i\equiv R_j\pmod m\), \(i

Comment. This move constructs a multiple without explicitly finding it.

Problems

Problems

#17.1
#17.1

Remainder by Digit Sum

Digit Sum Grade 7 Grade 8 ★☆☆☆☆

Find the remainder of \(7345821\) when divided by \(9\), without long division.

Details
Problem: NT-B1-M10-P001
Difficulty: Level 1 of 5
Tag: Digit Sum
Grade: Grade 7, Grade 8
#17.2
#17.2

Divisibility by \(11\)

Modulo Grade 7 Grade 8 ★☆☆☆☆

Check whether \(9182734\) is divisible by \(11\).

Details
Problem: NT-B1-M10-P002
Difficulty: Level 1 of 5
Tag: Modulo
Grade: Grade 7, Grade 8
#17.3
#17.3

Last Digit of a Power

Power Cycle Grade 7 Grade 8 ★☆☆☆☆

Find the last digit of \(3^{2026}\).

Details
Problem: NT-B1-M10-P003
Difficulty: Level 1 of 5
Tag: Power Cycle
Grade: Grade 7, Grade 8
#17.4
#17.4

A Number in Base \(b\)

Base Representation Grade 7 Grade 8 ★☆☆☆☆

Write \((341)_b\) as an expression in \(b\).

Details
Problem: NT-B1-M10-P004
Difficulty: Level 1 of 5
Tag: Base Representation
Grade: Grade 7, Grade 8
#17.5
#17.5

Repunit of Length \(4\)

Repunit Grade 7 Grade 8 ★☆☆☆☆

Represent \(1111\) in the form \(\frac{10^n-1}{9}\).

Details
Problem: NT-B1-M10-P005
Difficulty: Level 1 of 5
Tag: Repunit
Grade: Grade 7, Grade 8
#17.6
#17.6

Digit Sum and Remainder

Digit Sum Grade 8 Grade 9 ★★☆☆☆

Find all digits \(x\) for which \(52x47\) is divisible by \(9\).

Details
Problem: NT-B1-M10-P006
Difficulty: Level 2 of 5
Tag: Digit Sum
Grade: Grade 8, Grade 9
#17.7
#17.7

Unknown Digit and \(11\)

Modulo Grade 8 Grade 9 ★★☆☆☆

Find the digit \(x\) if \(63x915\) is divisible by \(11\).

Details
Problem: NT-B1-M10-P007
Difficulty: Level 2 of 5
Tag: Modulo
Grade: Grade 8, Grade 9
#17.8
#17.8

Last Two Digits

Power Cycle Grade 8 Grade 9 ★★☆☆☆

Find the last two digits of \(9^{37}\).

Details
Problem: NT-B1-M10-P008
Difficulty: Level 2 of 5
Tag: Power Cycle
Grade: Grade 8, Grade 9
#17.9
#17.9

Bases with Divisibility by \(5\)

Linear Congruence Grade 8 Grade 9 ★★☆☆☆

Find all bases \(b>4\) for which \((34)_b\) is divisible by \(5\).

Details
Problem: NT-B1-M10-P009
Difficulty: Level 2 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#17.10
#17.10

Period of \(\frac{1}{13}\)

Decimal Period Grade 8 Grade 9 ★★☆☆☆

Find the period length of \(\frac{1}{13}\).

Details
Problem: NT-B1-M10-P010
Difficulty: Level 2 of 5
Tag: Decimal Period
Grade: Grade 8, Grade 9
#17.11
#17.11

Divisibility of \(R_6\)

Divisibility Grade 8 Grade 9 ★★☆☆☆

Prove that \(R_6=111111\) is divisible by \(37\).

Details
Problem: NT-B1-M10-P011
Difficulty: Level 2 of 5
Tag: Divisibility
Grade: Grade 8, Grade 9
#17.12
#17.12

Rearranged Digits

Digit Sum Grade 8 Grade 9 ★★☆☆☆

Prove that the difference of two numbers formed from the same decimal digits is divisible by \(9\).

Details
Problem: NT-B1-M10-P012
Difficulty: Level 2 of 5
Tag: Digit Sum
Grade: Grade 8, Grade 9
#17.13
#17.13

Even-Length Palindrome

Modulo Grade 8 Grade 9 ★★★☆☆

Prove that every decimal palindrome with an even number of digits is divisible by \(11\).

Details
Problem: NT-B1-M10-P013
Difficulty: Level 3 of 5
Tag: Modulo
Grade: Grade 8, Grade 9
#17.14
#17.14

When \(37\mid R_n\)

Repunit Grade 8 Grade 9 ★★★☆☆

Find all \(n\ge1\) for which \(R_n\) is divisible by \(37\).

Details
Problem: NT-B1-M10-P014
Difficulty: Level 3 of 5
Tag: Repunit
Grade: Grade 8, Grade 9
#17.15
#17.15

Divisibility of \(R_{6n}\)

Divisibility Grade 8 Grade 9 ★★★☆☆

Prove that the number consisting of \(6n\) ones is divisible by \(7\), \(11\), and \(13\).

Details
Problem: NT-B1-M10-P015
Difficulty: Level 3 of 5
Tag: Divisibility
Grade: Grade 8, Grade 9
#17.16
#17.16

Sum of Powers

Chinese Remainder Theorem Grade 8 Grade 9 ★★★☆☆

Find the last two digits of \(3^{2026}+7^{2026}\).

Details
Problem: NT-B1-M10-P016
Difficulty: Level 3 of 5
Tag: Chinese Remainder Theorem
Grade: Grade 8, Grade 9
#17.17
#17.17

Three-Digit Number in Base \(b\)

Base Representation Grade 8 Grade 9 ★★★☆☆

Find all bases \(b>5\) for which \((251)_b\) is divisible by \(13\).

Details
Problem: NT-B1-M10-P017
Difficulty: Level 3 of 5
Tag: Base Representation
Grade: Grade 8, Grade 9
#17.18
#17.18

Period of \(\frac{1}{27}\)

Decimal Period Grade 8 Grade 9 ★★★☆☆

Find the period length of \(\frac{1}{27}\).

Details
Problem: NT-B1-M10-P018
Difficulty: Level 3 of 5
Tag: Decimal Period
Grade: Grade 8, Grade 9
#17.19
#17.19

Divisibility by \(31\)

Repunit Grade 9 Grade 10 ★★★☆☆

Find all \(n\) for which \(31\mid R_n\).

Details
Problem: NT-B1-M10-P019
Difficulty: Level 3 of 5
Tag: Repunit
Grade: Grade 9, Grade 10
#17.20
#17.20

Difference with the Reversed Number

Proof Grade 9 Grade 10 ★★★☆☆

Let \(N\) be a four-digit number, and let \(M\) be obtained by reversing its digits. Prove that \(N-M\) is divisible by \(9\).

Details
Problem: NT-B1-M10-P020
Difficulty: Level 3 of 5
Tag: Proof
Grade: Grade 9, Grade 10
#17.21
#17.21

A Multiple Made of Ones

Pigeonhole principle Grade 9 Grade 10 ★★★★☆

Let \(\gcd(m,10)=1\). Prove that there exists a number consisting only of digit \(1\) that is divisible by \(m\).

Details
Problem: NT-B1-M10-P021
Difficulty: Level 4 of 5
Tag: Pigeonhole principle
Grade: Grade 9, Grade 10
#17.22
#17.22

A Number Made of Nines

Pigeonhole principle Grade 9 Grade 10 ★★★★☆

Is it true that for every positive integer \(m\), there exists a number written only with digit \(9\) that is divisible by \(m\)? Give the exact corrected statement.

Details
Problem: NT-B1-M10-P022
Difficulty: Level 4 of 5
Tag: Pigeonhole principle
Grade: Grade 9, Grade 10
#17.23
#17.23

When \(R_a\mid R_b\)

Proof Grade 9 Grade 10 ★★★★☆

Prove that if \(R_a\mid R_b\), then \(a\mid b\).

Details
Problem: NT-B1-M10-P023
Difficulty: Level 4 of 5
Tag: Proof
Grade: Grade 9, Grade 10
#17.24
#17.24

A Multiple of \(2026\) with Digits \(0\) and \(1\)

Divisibility Grade 9 Grade 10 ★★★★★

Prove that there exists a positive integer consisting only of digits \(0\) and \(1\) that is divisible by \(2026\).

Details
Problem: NT-B1-M10-P024
Difficulty: Level 5 of 5
Tag: Divisibility
Grade: Grade 9, Grade 10

Ladders

No published ladders were found.
Previous Chapter
Next Chapter