Placement AptitudeVery hardCAT · Infosys

How many of the integers 1, 2, …, 100 can be written as x² − y² with x and y non-negative integers?

  1. A. 50
  2. B. 25
  3. C. 75
  4. D. 100

Correct answer: C. 75

x² − y² = (x − y)(x + y), and the two factors have the same parity, so the result is odd or a multiple of 4; every such n works (odd n = 2k + 1 = (k+1)² − k², 4m = (m+1)² − (m−1)²). Only numbers of the form 4k + 2 fail: 25 of them, leaving 75. 50 counts only odd numbers.

More Permutations, Combinations and Probability (Placement) questions

Exams that ask this topic