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?
Practice this conceptself-check · 4 quick reps

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?
Practice this conceptself-check · 4 quick reps

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)

Drill every past-year question on this subtopic

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