PYQ Vault

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

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 N≥1N \ge 1 needs exactly kk bits in binary when it lies in the range

2k−1≤N≤2k−1.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 2k−12^k - 1 is the largest kk-bit number: kk ones.

Bit count of N

2k−1≤N≤2k−1 ⟹ 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

The same idea in a real exam question:

NDA · Apr 2023 · Q3Easy

Example 1 · Binary Numbers · Binary Representation and Number Theory

What is the binary number equivalent to decimal number 1011?

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

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+⋯+(2n−1)=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.) LCM and HCF by prime factorisation: write each number as a product of prime powers; the HCF takes the LOWEST power of each common prime, the LCM takes the HIGHEST power of every prime that appears; and HCF×LCM=\text{HCF}\times\text{LCM}= product of the two numbers. A binary question is often this in disguise — convert (1100)2=12(1100)_2=12 and (10010)2=18(10010)_2=18, then 12=22⋅312=2^2\cdot3, 18=2⋅3218=2\cdot3^2, LCM =22⋅32=36=(100100)2=2^2\cdot3^2=36=(100100)_2, HCF =6=(110)2=6=(110)_2, and convert back.

Sum of first n odd numbers

1+3+5+⋯+(2n−1)=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

The same idea in a real exam question:

NDA · Sep 2025 · Q9Moderate

Example 2 · Binary Numbers · Binary Representation and Number Theory

What is the remainder when 5995^{99} is divided by 13?

Reduce the exponent by the CYCLE length, not the modulus

For 599 mod 135^{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)

Test yourself on a real paper

Sit a past NDA paper, timed and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.