Number Theory Problem

Number Theory Level pending

How many numbers between 1 and 10000 inclusive can be written as a difference of perfect squares ? For example, 4 4 can be written as 2 2 0 2 2^2-0^2 .

2500 7500 5000 3300

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Raymond Park
Jul 16, 2016

Two squares? This looks like a job for modular arithmetic! We have m 2 n 2 = k m^2-n^2=k . M o d 4 Mod 4 isn't bad to use, since all squares have the residue of 0 or 1 when divided by 4. So, we have 3 cases

  • m 2 = = 0 ( m o d 4 ) n 2 c o n g r u e n t 0 ( m o d 4 ) m^2 == 0 (mod 4) - n^2 congruent 0 (mod 4) resulting in k = = 0 ( m o d 4 ) k == 0 (mod 4) k k is divisible by 4 4 and there are 10000 / 4 10000/4 integers fitting this requirement. 2500 i n t e g e r s 2500 integers
  • m 2 = = 1 ( m o d 4 ) n 2 = = 0 ( m o d 4 ) m^2 == 1 (mod 4) - n^2 == 0 (mod 4) resulting k = = 1 ( m o d 4 ) k == 1 (mod 4) . So k k is 1 , 5 , 9 , 13 1,5,9,13 ... or every 4 n + 1 4n+1 where n is a whole number. We will save this requirement for the final one
  • m 2 = = 0 ( m o d 4 ) n 2 = = 1 ( m o d 4 ) m^2 == 0 (mod 4) - n^2 == 1 (mod 4) resulting k = = 3 ( m o d 4 ) k == 3( mod 4) So k k is 3 , 7 , 11 , 15 3,7,11,15 .... or every 4 n 1 4n-1 where n is a whole number. Combining what we found out from the last two cases, we conclude that k k can be any odd integer between 1 1 and 10000 10000 . There are 10000/2 of them 5000 i n t e g e r s 5000 integers

So our answer is 7500 7500

Chirag Singla
Jul 30, 2020

m 2 n 2 = ( m n ) ( m + n ) . m^2-n^2=(m-n)(m+n). If m, n are consecutive integers then their difference will be 1 1 and sum will be an odd integer. H e n c e , m 2 n 2 Hence, m^2-n^2 = An Odd Integer. Thus, every odd integer can be written as difference of two squares. If, m , n m, n are both odd or both even then, 2 m n 2|m-n and 2 m + n 2|m+n => 4 ( m 2 n 2 ) 4|(m^2-n^2) Every, no. divisible by 4, can also be written as difference of two squares. 5000 + 2500 = 7500 5000+2500= \>7500

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...