NDA Maths · Binary Numbers

Binary Representation & Number Theory

A small grab-bag the NDA files under Binary Numbers: representing a decimal number in binary (and counting its bits), plus a couple of pure number-theory recall items — modular remainders by cycling, and the sum-of-odd-numbers perfect-square fact.

Why this matters

Three PYQs sit here. One is a direct decimal-to-binary representation; the other two are number-theory one-liners (a remainder-by-cycling and a perfect-square recognition) that happen to be grouped with binary in the syllabus. They reward two reflexes you can memorise: powers repeat in a short cycle modulo a number, and 1 + 3 + 5 + ... + (2n − 1) = n².

Concept 1 of 2

Representing a Number in Binary & Counting Its Bits

Intuition

Representing a decimal number in binary is the same repeated-division skill from Subtopic 1, but here the question often cares about HOW MANY bits the answer needs — which is governed by where the number sits between consecutive powers of 2.

Definition

A decimal number N1N \ge 1 needs exactly kk bits in binary when it lies in the range

2k1N2k1.2^{k-1} \le N \le 2^k - 1.
Equivalently, the number of bits is one more than the highest power of 2 not exceeding NN. For example 10111011 lies between 29=5122^9 = 512 and 210=10242^{10} = 1024, so its binary form uses 10 bits; converting by repeated division gives 1011=(1111110011)21011 = (1111110011)_2.

  • A number that is exactly 2k2^k is the smallest (k+1)(k+1)-bit number: a 1 followed by kk zeros.
  • A number that is exactly 2k12^k - 1 is the largest kk-bit number: kk ones.

Bit count of N

2k1N2k1  N uses k bits2^{k-1} \le N \le 2^k - 1 \ \Longrightarrow\ N \text{ uses } k \text{ bits}

Worked example

How many bits are needed to write 10010100_{10} in binary, and what is that binary form?
  1. Locate 100100 between powers of 2: 26=64100<128=272^6 = 64 \le 100 < 128 = 2^7, so it needs 77 bits.
  2. Convert (greedy powers): 100=64+32+4=26+25+22100 = 64 + 32 + 4 = 2^6 + 2^5 + 2^2.
  3. Place 1s at positions 6,5,26, 5, 2 and 0s elsewhere: (1100100)2(1100100)_2.
Answer:77 bits; 10010=(1100100)2100_{10} = (1100100)_2.
Practice this conceptself-check · 4 quick reps

Try it yourself

How many bits does 25010250_{10} need in binary?

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    How many bits to write 311031_{10}?
  2. 2.
    How many bits to write 321032_{10}?
  3. 3.
    What is the largest number representable in 4 bits?
  4. 4.
    Convert 20010200_{10} to binary.

From the bank · past-year question

Example 1Binary NumbersEASY
What is the binary number equivalent to decimal number 1011?

[Q3 · Apr · 2023]

Watch the digit COUNT in the options

Representation questions often offer distractors with the wrong number of bits (one too few or too many). Bracket NN between consecutive powers of 2 first to know how many bits the correct answer must have, then convert.

Concept 2 of 2

Number-Theory One-Liners — Remainder Cycles & Sum of Odd Numbers

Intuition

These two questions aren't about binary at all — they're number-theory facts the syllabus groups here. The first uses the fact that powers repeat in a short cycle when you take remainders. The second uses the clean identity that adding the first n odd numbers always gives a perfect square, n².

Definition

Remainder by cycling: the remainders of a1,a2,a3,a^1, a^2, a^3, \ldots modulo a fixed number repeat with some period LL. Find the cycle by computing remainders until they repeat, then reduce the exponent modulo LL: if the exponent leaves remainder tt on division by LL, then aexpa^{\text{exp}} has the same remainder as ata^t. Sum of the first n odd numbers:

1+3+5++(2n1)=n2.1 + 3 + 5 + \cdots + (2n - 1) = n^2.
So if a sum of consecutive odd numbers from 1 equals some value SS, the number of terms is n=Sn = \sqrt{S} — and SS must be a perfect square. (A neat NDA case: 12345678987654321=111111111\sqrt{12345678987654321} = 111111111.)

Sum of first n odd numbers

1+3+5++(2n1)=n21 + 3 + 5 + \cdots + (2n - 1) = n^2

Worked example

What is the remainder when 31003^{100} is divided by 7?
  1. Cycle of 3nmod73^n \bmod 7: 313, 322, 336, 344, 355, 3613^1 \equiv 3,\ 3^2 \equiv 2,\ 3^3 \equiv 6,\ 3^4 \equiv 4,\ 3^5 \equiv 5,\ 3^6 \equiv 1 — period L=6L = 6.
  2. Reduce the exponent: 100=6×16+4100 = 6 \times 16 + 4, so 310034(mod7)3^{100} \equiv 3^4 \pmod 7.
  3. From the cycle, 3443^4 \equiv 4.
Answer:Remainder 44.
Practice this conceptself-check · 4 quick reps

Try it yourself

How many terms of 1+3+5+7+1 + 3 + 5 + 7 + \cdots are needed for the sum to equal 441441?

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Sum of the first 10 odd numbers?
  2. 2.
    1+3+5+=1691 + 3 + 5 + \cdots = 169: how many terms?
  3. 3.
    Remainder of 2102^{10} divided by 3?
  4. 4.
    Remainder of 747^{4} divided by 5?

From the bank · past-year question

Example 2Binary NumbersMODERATE
What is the remainder when 5995^{99} is divided by 13?

[Q9 · Sep · 2025]

Reduce the exponent by the CYCLE length, not the modulus

For 599mod135^{99} \bmod 13, the powers cycle with period 4 (not 13). Reduce 9999 modulo 4, not modulo 13. Find the actual cycle length first by listing remainders until one repeats.

Sum of odd numbers is a PERFECT SQUARE

If a sum of 1+3+5+1 + 3 + 5 + \cdots is given, the term count is sum\sqrt{\text{sum}}. Recognising a value like 1234567898765432112345678987654321 as 1111111112111111111^2 is the intended shortcut — don't try to add the series term by term.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (2)

Watch out for (3)

Mastery check — 1 interleaved questions

Try each one before clicking. Questions are interleaved across the concepts above, not grouped — interleaving sharpens transfer.

Example 1Binary NumbersHARD
How many terms of the series 1+3+5+7+1+3+5+7+\ldots amount to a sum equal to 1234567898765432112345678987654321?

[Q6 · Sep · 2025]

Drill every past-year question on this subtopic

3 questions from the bank — paginated, with cart and Word-export support.