In: Computer Science
What percentage of the first 500 natural number can be written as the difference of two perfect square?
All The odd numbers can necessarily be written as difference of two squares. For example 1 = (1)^2 - (0)^2, 9 = (5)^2 - (4)^2 etc.
Besides the odd numbers, all numbers starting with 4 with a gap of 4 could be expressed as difference of 2 squares. For example 4 = (2)^2 - (0)^2, 40 = (11)^2 - (9)^2 etc.
Thus we have 250 odd numbers (in first 500 Natural numbers) + 125 numbers (multiples of 4) (in first 500 Natural numbers) that could be expressed as difference of squares.
250 + 125 = 375.
(375/500)*100 = 75%.
So 75% of the Numbers could be expressed as difference of two squares.
All numbers except those congruent to 2 mod 4 are representable as the difference of two perfect squares. These are just twice the odd numbers, so {2, 6, 10, 14, …}. There are 125 of these between 1 and 500, so 75% of the natural numbers less than 500 can be so written.
75%