GATE / CS ARCHIVE

SUBJECT COLLECTION

Discrete Mathematics · Proof Techniques & Number Theory

20 questions, newest first

GATE CSE has asked 20 questions on Proof Techniques & Number Theory (Discrete Mathematics) from 1991 to 2025, in 18 of the 46 papers; the most recent is in GATE CSE 2025 Set 2. In the last five years it carried 0.4 marks per 100-mark paper on average, against 0.5 since 2003. Since 2014 the questions have been 6 NAT, 1 MCQ and 1 MSQ. 3 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
1 mark · MCQ
Report issue

Proof Techniques & Number Theory

Question 15, GATE 2025: P(x) is any predicate on the natural numbers, with 0 included. Which implication is valid for every P?
A. [P(0) and ∀x(P(x)⇒P(x+1))] ⇒ ∀x P(x).
B. [P(0) and ∀x(P(x)⇒P(x−1))] ⇒ ∀x P(x).
C. [P(1000) and ∀x(P(x)⇒P(x−1))] ⇒ ∀x P(x).
D. [P(1000) and ∀x(P(x)⇒P(x+1))] ⇒ ∀x P(x).
For downward steps, interpret the implication only where x−1 is in the domain.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

A is the induction principle. P(0) supplies the first case. The upward step gives P(1) from P(0), then P(2) from P(1), and so on. Every nonnegative integer is reached after finitely many upward steps, proving ∀x P(x).

The direction of the step must match the base and the target domain. B starts at the smallest element and moves downward, so it cannot establish any positive case. For example, P(x) meaning “x=0” satisfies the meaningful downward condition and P(0), but not all natural numbers satisfy P. C can cover 0 through 1000, not larger numbers; P(x) meaning “x≤1000” is a counterexample. D can cover 1000 upward, but not smaller numbers; use P(x) meaning “x≥1000.” Thus A alone is valid. Literally writing P(−1) for a predicate only defined on natural numbers is a domain issue in B/C; it does not supply the missing coverage.

Original paper, page 13 · Answer key

2 marks · MSQ
Report issue

Proof Techniques & Number Theory

Question 51, GATE 2022: Given f(1)=1, f(2n)=2f(n)−1, f(2n+1)=2f(n)+1 for n≥1, select identities for positive n: A f(2^n−1)=2^n−1; B f(2^n)=1; C f(5·2^n)=2^(n+1)+1; D f(2^n+1)=2^n+1.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A,B,C

For positive integer n, prove A by induction: f(1)=1, and applying the odd recurrence to 2n+1-1=2(2n-1)+1 preserves f(2n-1)=2n-1. For B, repeated use of f(2m)=2f(m)-1 starting with f(1)=1 yields f(2n)=1. Also f(5)=2f(2)+1=3. Repeated doubling gives f(5*2n)-1=2n(f(5)-1)=2n+1, proving C. D is false: at n=2, f(5)=3 whereas 22+1=5.

A useful closed form is f(m)=2(m−2^⌊log2(m)⌋)+1. It follows by induction on the binary length: the leading 1 determines the power of two, and the even/odd recurrence appends a bit while updating the residual. Substituting m=2n−1,2n,5·2n confirms the three identities and also shows f(2n+1)=3, not 2n+1 for n≥2.

Original paper, page 34 · Answer key

1 mark · NAT
Report issue

Reducing a large power modulo five

Proof Techniques & Number Theory

Question 21, GATE 2019: Compute 3^51 modulo 5. The exponent in the original is 51.
Tap to enlarge
Answer & solution

Official answer: 2

Method: find the repeating cycle of powers modulo 5, rather than form the large integer.

1. Compute successive residues: 3¹≡3, 3²=9≡4, 3³≡4×3=12≡2, and 3⁴≡2×3=6≡1 (mod 5).
2. Once the residue is 1, the next powers repeat this four-step pattern. Write 51=4×12+3.
3. Therefore 351=(3⁴)12·3³≡112·2≡2 (mod 5).
4. The residue 2 already lies in the standard range 0 through 4, so no further reduction is needed.

Result: 2.

Original paper, page 8 · Answer key

2 marks · NAT
Report issue

Proof Techniques & Number Theory

Question 47, GATE 2017: How many integers from 1 through 500 inclusive are divisible by 3 or 5 or 7?
Tap to enlarge
Answer & solution

Official answer: 271.0

Our answer: 271

1. Count multiples separately: floor(500/3)=166, floor(500/5)=100, floor(500/7)=71. Their sum double-counts integers divisible by more than one divisor.

2. Subtract pairwise intersections using least common multiples 15,21,35: 33,23,14 respectively. Triple multiples of 105 were counted three times then subtracted three times, so restore floor(500/105)=4.

3. The union size is 166+100+71−33−23−14+4=271. Inclusive endpoints are handled by the floor counts.

Original paper, page 21 · Answer key

2 marks · NAT
Report issue

Proof Techniques & Number Theory

Question 29, GATE 2016: Find 13^99 modulo 17, expressed from 0 through 16.
Tap to enlarge
Answer & solution

Official answer: 4.0 : 4.0

Our answer: 4

13²=169≡−1 modulo 17, so 13⁴≡1. Since99≡3 modulo 4, 1399≡13³≡−13≡4 modulo 17.

The powers cycle as 13,16,4,1 modulo 17. Write 99=4×24+3, then replace 134×24 by 1 and retain the third power. Working modulo after every multiplication avoids enormous integers. The intermediate −13 is a valid congruence but must be reported as 4 in the specified nonnegative range.

Original paper, page 33 · Answer key

1 mark · NAT
Report issue

Proof Techniques & Number Theory

Question 14, GATE 2015: How many positive divisors does 2100 have?
Tap to enlarge
Answer & solution

Official answer: 36

2100=2²·3·5²·7. A positive divisor independently chooses exponents 0..2, 0..1, 0..2, 0..1, yielding 3·2·3·2=36.

Prime factorization is 2100=21×100=2²·3¹·5²·7¹. Every positive divisor uniquely selects an exponent for each prime, no larger than the original exponent. Choices are 3 for the power of 2, 2 for 3, 3 for 5, and 2 for 7. Multiply 3×2×3×2=36. This includes 1(all exponents 0)and 2100(all maximal); negative divisors are not included in the conventional count.

Original paper, page 31 · Answer key

2 marks · NAT
Report issue

Proof Techniques & Number Theory

Question 37, GATE 2014: Five bags are labeled 1 to 5. Each bag contains coins all weighing either 10 g or 11 g. Take respectively 1,2,4,8,16 coins from the five bags; their total weight is 323 g. Find the product of the labels of the bags with 11 g coins.
Tap to enlarge
Answer & solution

Official answer: 12

1. Method and setup. The powers-of-two sample sizes encode the heavy bags uniquely. Subtract the weight obtained if every selected coin were light; each heavy bag contributes exactly its sampled number of extra grams. The requested product uses bag labels, not the numbers of coins taken.

2. Work through the result and its assumptions. If all selected coins weighed10g, total weight would be 31×10=310g. The extra 13g has binary decomposition 13=1+4+8. Thus bags 1, 3, 4 contain 11g coins, and the product of labels is 1×3×4=12.

Original paper, page 16 · Answer key

2 marks · NAT
Report issue

Proof Techniques & Number Theory

Question 49, GATE 2014: How many distinct positive integer divisors does 2014 have?
Tap to enlarge
Answer & solution

Official answer: 8

1. Set up the reasoning. Factor completely: 2014=2×1007=2×19×53. The factors 2,19,53 are distinct primes, each with exponent one.

2. Derive the result. 2014=2·19·53, three distinct primes. Each positive divisor selects exponent 0 or 1 for each prime, giving 2³=8 divisors.

3. Check the interpretation. Every divisor independently chooses whether to contain each prime. The divisor-count formula is the product of exponent-plus-one values; include both 1 and 2014 among the eight divisors.

Original paper, page 42 · Answer key

2 marks · MCQ
Report issue

Predicate characterizing primes

Proof Techniques & Number Theory

Question 30, GATE 2011: For positive integers x,y,z, let P(x)=NOT(x=1) AND ∀y((∃z(x=y*z)) ⇒ ((y=x) OR (y=1))). Which option correctly characterizes P(x)? The source says 'P(x) being true means' in A, B and D.

(A) x is prime
(B) x is a number other than 1
(C) P(x) is always true regardless of x
(D) x has exactly two factors other than 1 and x
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A as exact characterization; B is also a necessary consequence

The predicate excludes 1 and requires every positive divisor y of x to be either 1 or x. Thus it is equivalent to x being prime, A. The wording P(x) being true means... is potentially only implication: under that reading B, x is a number other than 1, is also true because it is explicitly a conjunct. A is the exact characterization and the official choice; uniqueness requires reading means as a full characterization rather than any necessary consequence.

Read the inner existential as 'y divides x': there exists a positive integer z with x=yz. The universal implication then says that whenever y is a divisor it is either 1 or x. For x=7 only these divisors occur, whereas x=6 fails at y=2,z=3. The leading conjunct rejects x=1. D incorrectly requires additional factors, and C fails for composites. B is a necessary consequence but not a sufficient description, as 6 is not 1 yet does not satisfy P.

Original paper, page 8 · Answer key

2 marks · MCQ
Report issue

Odd and even integer sums

Proof Techniques & Number Theory

Question 24, GATE 2008: For positive integer k, P is the sum of odd i with 1≤i≤2k, and Q is the sum of even i in the same range. Which relation holds?

(A) P=Q−k
(B) P=Q+k
(C) P=Q
(D) P=Q+2k
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Write the odd terms as 2j−1 and their paired even terms as 2j, for j=1,…,k.
2. Each even term exceeds its odd partner by exactly one, so Q−P=Σ1=k.
3. Rearrange to P=Q−k, A. Equivalently P=k² and Q=k(k+1).

Original paper, page 5

2 marks · MCQ
Report issue

Nested prime-power encoding

Proof Techniques & Number Theory

Question 39, GATE 2003: Let Σ={a,b,c,d,e}, with g(a)=3,g(b)=5,g(c)=7,g(d)=9,g(e)=11, and let pᵢ be the ith prime (p₁=2). Encode a nonempty string s=a₁...aₙ by f(s)=product pᵢ^g(aᵢ), and a nonempty sequence of nonempty strings (s₁,...,sₘ) by h=product pᵢ^f(sᵢ). Which can be such an h? A. 2⁷3⁷5⁷; B. 2⁸3⁸5⁸; C. 2⁹3⁹5⁹; D. 2¹⁰5¹⁰7¹⁰.
Question 39, GATE 2003: Let Σ={a,b,c,d,e}, with g(a)=3,g(b)=5,g(c)=7,g(d)=9,g(e)=11, and let pᵢ be the ith prime (p₁=2). Encode a nonempty string s=a₁...aₙ by f(s)=product pᵢ^g(aᵢ), and a nonempty sequence of nonempty strings (s₁,...,sₘ) by h=product pᵢ^f(sᵢ). Which can be such an h? A. 2⁷3⁷5⁷; B. 2⁸3⁸5⁸; C. 2⁹3⁹5⁹; D. 2¹⁰5¹⁰7¹⁰.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Prime factorization makes the outer positions and exponents uniquely recoverable. Every inner nonempty string encoding begins with at least 2³, so it is divisible by 8. Thus exponents 7,9,10 cannot encode any inner string. Conversely exponent 8 is exactly f(a), and B uses consecutive outer primes with three such exponents.

2. A string encoding f(s) uses consecutive primes starting with 2, with exponents from{3,5,7,9,11}. In particular f(a)=2³=8. Therefore 28·38·58 is the sequence encoding of(a,a,a), so B. Exponents 7 and 9 are not valid nonempty string encodings because such encodings are divisible by 8. D skips prime 3 in the outer encoding and also uses exponent 10, which is invalid.

Original paper, page 5

Descriptive
Report issue

Induction for sums of consecutive integers

Proof Techniques & Number Theory

Question 3(b), GATE 2001: S(n)=0+1+⋯+n for natural numbers including 0. Prove S(m+n)=S(m)+S(n)+mn.

Task: Give an induction proof of the stated sum identity.
Question 3(b), GATE 2001: S(n)=0+1+⋯+n for natural numbers including 0. Prove S(m+n)=S(m)+S(n)+mn.

Task: Give an induction proof of the stated sum identity.
Tap to enlarge
Shared context

S(n)=0+1+⋯+n for natural numbers including 0. Prove S(m+n)=S(m)+S(n)+mn.

Answer & solution

Answer: S(m+n)=S(m)+S(n)+mn for all m,n≥0. (no official key was published)

1. Fix an arbitrary natural number m and induct on n. This proves the statement for all n for each m, and hence for all pairs.

2. Base n=0: S(m+0)=S(m), while S(m)+S(0)+m·0=S(m).

3. Inductive hypothesis: assume S(m+n)=S(m)+S(n)+mn. By the defining sum, S(m+n+1)=S(m+n)+(m+n+1).

4. Substitute the hypothesis and regroup: S(m+n+1)=S(m)+S(n)+mn+m+n+1 = S(m)+[S(n)+(n+1)]+m(n+1) = S(m)+S(n+1)+m(n+1).

5. This proves the induction step without assuming the closed form n(n+1)/2. Since m was arbitrary, the required two-variable identity follows.

Original paper, page 7

Descriptive
Report issue

Induction for a minimum recurrence

Proof Techniques & Number Theory

Question 3, GATE 2000: s₁=s₂=1 and sᵢ=1+min(sᵢ₋₁,sᵢ₋₂) for i>2.

Task: Prove sₙ=⌈n/2⌉ by induction.
Tap to enlarge
Shared context

s₁=s₂=1 and sᵢ=1+min(sᵢ₋₁,sᵢ₋₂) for i>2.

Answer & solution

Answer: sₙ=⌈n/2⌉ for n≥1. (no official key was published)

1. Use strong induction because the recurrence depends on two previous terms. The proposed formula gives 1 for n=1 and n=2, matching both initial conditions.

2. Assume the formula holds through n−1, with n≥3. Then sₙ=1+min(⌈(n−1)/2⌉,⌈(n−2)/2⌉). The second ceiling is no larger, so the minimum is ⌈(n−2)/2⌉.

3. Because subtracting an integer commutes with ceiling, ⌈(n−2)/2⌉=⌈n/2⌉−1. Therefore sₙ=⌈n/2⌉, completing induction.

4. Equivalently, n=2k gives 1+min(k,k−1)=k and n=2k+1 gives 1+min(k,k)=k+1. The first terms 1,1,2,2,3,3 check the ceiling rather than floor convention.

Original paper, page 6

Descriptive
Report issue

Induction for polygon diagonals

Proof Techniques & Number Theory

Question 10(a), GATE 1998: Prove by induction that an n-sided polygon has n(n−3)/2 diagonals.
Question 10(a), GATE 1998: Prove by induction that an n-sided polygon has n(n−3)/2 diagonals.
Tap to enlarge
Answer & solution

Answer: D_n=n(n−3)/2 for n≥3. (no official key was published)

A diagonal joins two nonadjacent vertices; count all such vertex pairs, regardless of where segments lie for a nonconvex polygon. Let Dn be their number. A triangle has no diagonals, and 3(3−3)/2=0, establishing the base case.

Assume Dn=n(n−3)/2 for an n-gon. Insert a new vertex v between two formerly adjacent vertices u and w, replacing the boundary edge uw by the two boundary edges uv and vw. All old diagonals remain diagonals. The former edge uw becomes one additional diagonal. The new vertex v can be joined by diagonals to the n−2 old vertices other than its two neighbors u and w. Thus the increase is 1+(n−2)=n−1, not merely n−2.

Therefore Dn+1=Dn+n−1=n(n−3)/2+n−1=(n²−n−2)/2=(n+1)(n−2)/2. This is the required formula with n replaced by n+1, completing induction.

As a consistency check, choosing any pair of vertices gives n(n−1)/2 segments; subtract the n boundary edges to obtain n(n−3)/2. For n=4 the count is 2 and for n=5 it is 5, agreeing with the recurrence. The insertion argument's old-edge contribution is the usual subtle point in this induction.

Original paper, page 6

5 marks · Descriptive
Report issue

Prove Fibonacci parity by induction

Proof Techniques & Number Theory

Question 9, GATE 1996: Let f1=f2=1 and f_(n+2)=f_(n+1)+f_n for n≥1. Prove by induction that every third term is even.
Tap to enlarge
Answer & solution

Answer: For every k≥1, f_(3k) is even. (no official key was published)

Use induction on k, not on the original index one step at a time. The base case is f3=f2+f1=2, which is even. For the induction step, derive a recurrence connecting terms three positions apart:
fm+3=fm+2+fm+1=(fm+1+fm)+fm+1=2f_(m+1)+fm.

Assume f3k is even. Set m=3k in this identity. Then f3k+3=2f_(3k+1)+f3k is the sum of two even integers, hence even. This proves the claim for k+1 and completes the induction.

The proof deliberately does not assume anything about f3k+1: multiplying any integer by 2 makes it even. An alternative stronger invariant is that each consecutive block has parity odd,odd,even. Starting from 1,1,2, the recurrence gives the next block odd,odd,even again. This additionally proves that exactly the multiples of three have even terms, but the weaker requested conclusion already follows from the simpler induction above.

Original paper, page 8

5 marks · Descriptive
Report issue

Induction for exponential versus quadratic growth

Proof Techniques & Number Theory

Question 23, GATE 1995: Prove by mathematical induction that 2^n>n² for every integer n≥5.
Tap to enlarge
Answer & solution

Answer: Base32>25; induction follows from 2n²>(n+1)² for n≥5. (no official key was published)

Start at n=5: 25=32>25=5², so the claimed strict inequality holds. Now suppose it holds for some integer k≥5, namely 2k>k². Multiplying this strict inequality by 2 gives 2k+1>2k². To reach the desired conclusion, it remains to compare 2k² with (k+1)².

The difference is 2k²−(k+1)²=k²−2k−1=(k−1)²−2. Since k≥5, this is at least 16−2=14>0. Therefore 2k²>(k+1)², and chaining the two inequalities gives 2k+1>(k+1)². This proves the induction step. By mathematical induction the assertion holds for all integers n≥5.

The comparison in the middle is necessary: merely doubling both sides of the induction hypothesis does not automatically produce the next quadratic term. The starting value is also meaningful: at n=4 both sides equal 16, so the strict claim cannot start there. This proof covers the stated integer domain only; induction alone is not a proof for arbitrary real n.

Original paper, page 8

Descriptive
Report issue

Counting integers coprime to30

Proof Techniques & Number Theory

Question 25(b), GATE 1995: How many positive integers at most 720 are divisible by none of 2,3,5?
Tap to enlarge
Answer & solution

Answer: 192. (no official key was published)

Let A,B,C be the subsets of {1,…,720} divisible by 2,3,5 respectively. Their sizes are 360,240,144. Because the divisors are pairwise coprime, the pair intersections count multiples of 6,10,15, giving 120,72,48; the triple intersection counts multiples of 30, giving 24.

Inclusion–exclusion gives |A∪B∪C|=360+240+144−120−72−48+24=528. These are exactly the integers disqualified by at least one divisibility condition. Subtract from all 720 positive integers to obtain 720−528=192. The subtraction of pair intersections corrects double counting, while adding the triple intersection restores numbers removed too many times.

An independent way to see the count is to use blocks of 30. In each block the allowed residue classes are 1,7,11,13,17,19,23,29 modulo 30, eight in total. There are 720/30=24 complete blocks, hence 24×8=192. The residue 0 is not allowed, and the positive-integer domain excludes 0 anyway.

Original paper, page 8

Descriptive
Report issue

Geometric proof of odd-number sum

Proof Techniques & Number Theory

Question 15(a), GATE 1994: Using the displayed square-dot patterns containing 1,4,9,… dots, prove Σ_(i=0)^(n−1)(2i+1)=n² without induction.
Tap to enlarge
Answer & solution

Answer: Partition an n×n square into L-shaped layers of sizes 1,3,5,…,2n−1. (no official key was published)

1. Take dots with integer coordinates (r,c), 1≤r,c≤n. Assign each dot to layer k=max(r,c). This partitions the square without overlap.

2. Layer k contains row k through column k (k dots) and column k above row k (k−1 dots), totaling 2k−1.

3. Counting the square directly gives n² dots. Counting by the disjoint layers gives Σ_(k=1)n(2k−1), which is the requested sum after i=k−1.

4. This is a direct counting argument for arbitrary n, not an induction.

Diagram / structural description

The source shows successively 1×1, 2×2 and 3×3 square dot arrays labelled 1,4,9, followed by etc.

Original paper, page 6

Descriptive
Report issue

Deriving the triangular-number sum

Proof Techniques & Number Theory

Question 15(b), GATE 1994: Use the result Σ_(i=0)^(n−1)(2i+1)=n² from part (a) to prove Σ_(i=1)^n i=n(n+1)/2.
Question 15(b), GATE 1994: Use the result Σ_(i=0)^(n−1)(2i+1)=n² from part (a) to prove Σ_(i=1)^n i=n(n+1)/2.
Tap to enlarge
Answer & solution

Answer: Σ_(i=1)^n i=n(n+1)/2. (no official key was published)

1. Reindex part (a) as Σ_(i=1)n(2i−1)=n².

2. Distribute the finite sum: 2Σ_(i=1)n i − Σ_(i=1)n1 = n².

3. The second sum is n, so 2Σi=n²+n=n(n+1). Divide by two. This uses exactly the part(a) identity rather than a separate induction.

  • Original ID is 15(b), not a continuation of B+ tree Q14.

Original paper, page 6

5 marks · Descriptive
Report issue

Product identity for gcd and lcm

Proof Techniques & Number Theory

Question 15(a), GATE 1991: For positive integers a and b, prove gcd(a,b)·lcm(a,b)=ab.
Tap to enlarge
Answer & solution

Answer: gcd(a,b)·lcm(a,b)=ab. (no official key was published)

By unique prime factorization, write a=∏p pαp and b=∏p pβp, using exponent zero for a prime absent from either factorization. Only finitely many exponents are nonzero.

A common divisor cannot contain more copies of p than either number, so the largest possible exponent of p in the gcd is min(αp,βp). Conversely these minimum exponents do divide both numbers, proving gcd(a,b)=∏p pmin(αp,βp).

A common multiple must contain at least as many copies of p as each number, so the smallest possible exponent in the lcm is max(αp,βp). These maximum exponents form a multiple of both, proving lcm(a,b)=∏p pmax(αp,βp).

Multiplying adds exponents. Since min(u,v)+max(u,v)=u+v for any u,v, the product is ∏p pαp+βp=ab. This also covers a=1 or b=1 by the empty-product convention. Positivity avoids sign conventions and zero-related lcm special cases.

Original paper, page 8