Skip to content
Educora
IntermediateGrade 825 min17 / 59

Number systems: problems with an unknown base

Turn equalities with an unknown base into equations, find the base from the last digit or the number of digits, solve problems with consecutive digits and letter digits, and count 0s and 1s in binary quickly — in the style of DİM tasks.

Check yourself
In this lesson you will learn
  • Turn an equality with an unknown base into an equation and select the roots by the digit condition
  • Find the base from last digits (remainders) and from the number of digits
  • Solve problems about consecutive digits, digit sets given as letters and the largest k-digit number
  • Count the 0s and 1s in binary for differences of powers of two and for squares

Murad sees 13 + 15 = 31 on the board and laughs: “That’s wrong!” Leyla says: “Not so fast — you don’t know the base.” Indeed, if the numbers are written in base x, the equality becomes (x + 3) + (x + 5) = 3x + 1, so x = 7. Check: 13₇ = 10, 15₇ = 12, 31₇ = 22, and 10 + 12 = 22 ✓. In the four DİM entrance papers of 2025–2026, 4 of the 8 number-system tasks were such “unknown base” problems — both closed questions with 5 options and coded questions where you write the answer yourself. They all rest on one idea: the expanded form of a number (the lesson “Number systems: positional systems and binary”).

From the expanded form to an equation

aₖ…a₁a₀ₓ = aₖ·xᵏ + … + a₁·x + a₀, x > the largest digit
where:
  • xthe unknown base — a natural number, x ≥ 2
  • aᵢthe digits of the number

The digit condition: the base must be bigger than every digit in the equality. Roots of the equation that break this condition are thrown away.

  1. 1
    Condition

    Find the largest digit in the equality: x must be bigger than it.

  2. 2
    Expanded form

    Write every number with powers of x: from right to left 1, x, x², x³, …

  3. 3
    Equation

    Collect like terms and solve: a linear equation directly, a quadratic or cubic one by factorising.

  4. 4
    Selection

    Drop negative, zero and fractional roots, and roots not bigger than the largest digit.

  5. 5
    Check and answer the question

    Convert the numbers to decimal with the x you found and check the equality. Then find exactly what is asked: x itself, the largest three-digit number, its decimal value and so on.

Two identities (DİM-style closed task)

The equalities 35ₓ + 26ₓ = 63ₓ and 53ₙ − 25ₙ = 27ₙ are true. Find x + n in decimal.
A) 15 B) 16 C) 17 D) 18 E) 19

Show solution
First equality: the largest digit is 6 → x ≥ 7.
3x + 5 + 2x + 6 = 6x + 3 → 5x + 11 = 6x + 3 → x = 8.
Second: the largest digit is 7 → n ≥ 8.
5n + 3 − (2n + 5) = 2n + 7 → 3n − 2 = 2n + 7 → n = 9.
Check: 35₈ + 26₈ = 29 + 22 = 51 = 63₈ ✓; 53₉ − 25₉ = 48 − 23 = 25 = 27₉ ✓
x + n = 8 + 9 = 17. Correct answer: C) 17.
A cubic equation (coded task)

The equality 352ₓ + 544ₓ = 1006ₓ is true. Find the decimal value of the largest three-digit number in base x. Write the answer.

Show solution
The largest digit is 6 → x ≥ 7.
Expanded form: 3x² + 5x + 2 + 5x² + 4x + 4 = x³ + 6.
8x² + 9x + 6 = x³ + 6 → x³ − 8x² − 9x = 0 → x(x² − 8x − 9) = 0 → x(x − 9)(x + 1) = 0.
The roots are 0, 9, −1; only x = 9 meets the condition.
Check: 352₉ = 290, 544₉ = 445, 290 + 445 = 735 = 729 + 6 = 1006₉ ✓
The largest three-digit number is 888₉ = 9³ − 1 = 728.

Finding the base from the last digit or the number of digits

When you convert a number to base b, the first remainder is its last digit. So if N written in base b ends in r, then N − r is divisible by b, and also b > r, because r is a digit. If two such conditions are given, the base is a common divisor of both differences; pick the common divisor that satisfies the digit condition.

N = b·q + r, 0 ≤ r < b ⟹ b | (N − r), b > r
where:
  • rthe last digit of N in base b (the remainder)
  • b | MM is divisible by b

Last digit = the remainder of N divided by the base.

A DİM-style closed task

In which base does 43₁₀ end in the digit 7 and 57₁₀ end in the digit 9? (Find the base.)
A) 6 B) 8 C) 9 D) 12 E) 16

Show solution
43 − 7 = 36 and 57 − 9 = 48 must both be divisible by the base: the base is a common divisor of 36 and 48 — 2, 3, 4, 6, 12.
The last digit is 9, so the base is bigger than 9 → 12.
Check: 43 = 3·12 + 7 → 37₁₂; 57 = 4·12 + 9 → 49₁₂ ✓
Correct answer: D) 12.
A coded task

In how many bases does 29₁₀ end in the digit 5?

Show solution
The base must divide 29 − 5 = 24 and be bigger than 5: 6, 8, 12, 24.
Check: 29 = 4·6 + 5 = 45₆, 29 = 3·8 + 5 = 35₈, 29 = 2·12 + 5 = 25₁₂, 29 = 1·24 + 5 = 15₂₄.
Answer: 4.

The number of digits also tells you about the base. If N is written with exactly k digits in base b, it is not less than the smallest k-digit number (bᵏ⁻¹) and it is less than the smallest (k + 1)-digit number (bᵏ).

bᵏ⁻¹ ≤ N < bᵏ
where:
  • kthe number of digits of N in base b

Choose every natural base b ≥ 2 that satisfies this double inequality.

The base from the number of digits

In which bases is 50₁₀ a three-digit number?

Show solution
We need b² ≤ 50 < b³.
b² ≤ 50 → b ≤ 7 (7² = 49, 8² = 64).
50 < b³ → b ≥ 4 (3³ = 27, 4³ = 64).
Answer: b = 4, 5, 6, 7 — four bases. For example, 50 = 302₄ = 101₇.

Consecutive digits, custom digit sets and the largest number

In base n the digits are 0, 1, …, n − 1. So if a task says “m and n are consecutive numbers”, then m = n − 1, the largest digit of the system. Digits can also be given as letters: the set {0, 1, 2, p, q, r, s} has 7 digits, so the base is 7, and the letters take the values p = 3, q = 4, r = 5, s = 6 in order. In both cases the largest k-digit number has every digit equal to the largest digit.

mm…mₙ (k digits) = nᵏ − 1, m = n − 1
where:
  • nthe base
  • mthe largest digit of the system

For example, mmₙ = (n − 1)·n + (n − 1) = n² − 1: 77₈ = 63, 66₇ = 48.

Consecutive digits (DİM-style closed task)

In base n, m and n are consecutive natural numbers (m < n). If m0mₙ − mmₙ = 150₁₀, find n.
A) 5 B) 6 C) 7 D) 8 E) 9

Show solution
m = n − 1.
m0mₙ = m·n² + 0·n + m, mmₙ = m·n + m.
Difference: m·n² − m·n = m·n·(n − 1) = n(n − 1)² = 150.
n = 6: 6·5² = 150 ✓ (n = 5: 5·16 = 80; n = 7: 7·36 = 252).
Check: 505₆ = 185, 55₆ = 35, 185 − 35 = 150 ✓
Correct answer: B) 6.
Digits given as letters

A positional system has the digits {0, 1, 2, p, q, r, s}.
1) Write its largest three-digit number.
2) Find its decimal value.
3) Convert the number rq to decimal.

Show solution
There are 7 digits → base 7; p = 3, q = 4, r = 5, s = 6.
1) The largest digit is s → sss.
2) sss = 6·49 + 6·7 + 6 = 7³ − 1 = 342.
3) rq = 5·7 + 4 = 39.

A program can solve such problems too: int(s, x) reads the string s as a base-x number (2 ≤ x ≤ 36), and the rest is checking the bases in a loop. The program below first finds the bases in which 29 ends in 5, then the base of 352ₓ + 544ₓ = 1006ₓ and the decimal value of the largest three-digit number in that base:

Python
print([b for b in range(6, 30) if 29 % b == 5])
for x in range(7, 37):
    if int('352', x) + int('544', x) == int('1006', x):
        print(x, x**3 - 1)
▸ Expected output
[6, 8, 12, 24]
9 728
Exercise

In which base x is 154ₓ + 243ₓ = 430ₓ true? Complete the program so that it checks every base from 6 to 16 and prints the one that works. (The largest digit is 5, so x ≥ 6.)

Exercise · Python
for x in range(6, 17):
    # int('154', x) reads '154' as a base-x number
    pass
▸ Expected output
7

0s and 1s in binary: the harder cases

In “Number systems: positional systems and binary” you learned to split a number into different powers of two: each power gives one 1, and the largest power fixes the length. In DİM tasks the number is often given as a difference, a square or in another base. Two rules let you open it up without long calculation.

2ⁿ − 2ᵐ = 11…1 00…0₂ (n − m ones, m zeros), n > m
where:
  • n, mthe exponents

For example, 2⁸ − 2³ = 256 − 8 = 248 = 11111000₂: five 1s, three 0s.

(2ᵃ + 2ᶜ)² = 2²ᵃ + 2ᵃ⁺ᶜ⁺¹ + 2²ᶜ, a − c ≥ 2
where:
  • a, cthe exponents, a > c

When a − c ≥ 2 the three powers are different, so the square has exactly three 1s in binary; its number of digits is 2a + 1.

A square (DİM-style closed task)

In the binary form of 40₁₀², how many more 0s are there than 1s?
A) 3 B) 5 C) 6 D) 8 E) 11

Show solution
40 = 32 + 8 = 2⁵ + 2³ (a − c = 2).
40² = 2¹⁰ + 2⁹ + 2⁶ = 1024 + 512 + 64 = 1600 = 11001000000₂.
Largest power 2¹⁰ → 11 digits; 1s: 3; 0s: 11 − 3 = 8.
8 − 3 = 5. Correct answer: B) 5.
Differences and other bases

1) How many 1s are in the binary form of 2¹² − 2⁵?
2) How many 0s are in the binary form of 4⁶ + 2⁶ − 1?
3) How many 1s are in the binary forms of 7777₈ and F0F₁₆?

Show solution
1) 2¹² − 2⁵ = 11…1 00000₂: 12 − 5 = 7 ones (4064 = 111111100000₂).
2) 4⁶ = (2²)⁶ = 2¹²; 2⁶ − 1 = 111111₂. Sum: 1000000111111₂ — 13 digits, 7 ones, 6 zeros.
3) Every 7₈ = 111₂: 7777₈ → 12 ones. F0F₁₆ = 1111 0000 1111₂ → 8 ones (and 4 zeros).

This lesson completes the number-systems part. A short reminder: if the base is known, calculate with the methods of “Arithmetic in different number systems”; if it is unknown, build an equation from the expanded form and check the digit condition.

Key points

  • Turn an equality with an unknown base into an equation with the expanded form; the base must exceed the largest digit, other roots are dropped.
  • 121ₓ = (x + 1)², 100ₓ = x²; the largest k-digit number in base x is xᵏ − 1.
  • If N in base b ends in r, then b | (N − r) and b > r; with two such conditions the base is one of the common divisors.
  • If N has exactly k digits, bᵏ⁻¹ ≤ N < bᵏ; in base n the largest digit is n − 1, and the size of a digit set is the base.
  • 2ⁿ − 2ᵐ = (n − m) ones and m zeros; (2ᵃ + 2ᶜ)² = 2²ᵃ + 2ᵃ⁺ᶜ⁺¹ + 2²ᶜ (a − c ≥ 2) — three ones.

Check yourself

12 questions. Every correct answer earns XP.

1 / 12
If an equality contains 352ₓ, what is the smallest possible x?