Known by some as the hangover number

How many integers n n with 42 < n < 1729 42<n<1729 cannot be written as the difference of two squares of integers?


The answer is 421.

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

Garrett Clarke
Jun 14, 2015

1729 42 1 = 1686 1729-42-1=1686 numbers to check.

( n + 1 ) 2 n 2 = n 2 + 2 n + 1 n 2 = 2 n + 1 (n+1)^2-n^2 = n^2+2n+1-n^2=2n+1 , therefore if a number is odd it can be represented by the difference of two adjacent squares.

( n + 1 ) 2 ( n 1 ) 2 = n 2 + 2 n + 1 n 2 + 2 n 1 = 4 n (n+1)^2-(n-1)^2 = n^2+2n+1-n^2+2n-1=4n , which means that if a number is divisible by 4 4 then it can be represented by the difference of two squares.

Therefore we only need to check for numbers n n of the n 2 n\equiv 2 (mod 4 4 ).

Of the first 1684 1684 terms, 1 4 \frac{1}{4} of them must be of the desired form, and the last two numbers, 1727 1727 and 1278 1278 , have a remainder of 3 3 and 0 0 when divided by 4 4 , respectively. This means that our answer is 1684 × 1 4 = 421 1684\times\frac{1}{4} = \boxed{421} .

Largely correct, but how do you know that no n 2 ( mod 4 ) n\equiv 2(\text{mod }4) can be written as the difference of two squares?

Tijmen Veltman - 6 years ago

Log in to reply

If you square an odd number you get an odd number, and if you square an even number you get an even number, so if one square is odd and the other is even, the difference will be odd as well, which has already been covered. All of the rest of the combinations of possible differences in squares can be modeled by the equation: ( n + m ) 2 ( n m ) 2 = n 2 + 2 m n + m 2 n 2 + 2 m n n 2 = 4 m n (n+m)^2-(n-m)^2 = n^2+2mn+m^2-n^2+2mn-n^2=4mn , which means that the difference of any two odd squares or even squares must be divisible by 4, and therefore no difference of two squares can have the form n 2 n \equiv 2 (mod 4 4 ).

Garrett Clarke - 6 years ago
Mukul Sharma
Jun 13, 2015

For all no.s whose factor expression involving only 2 factors have odd odd or even even format are expressable as difference of squares of 2 positive integers. And for all no.s whose factoral expression is in the form of odd even format are expressable as the same. Use this to find the answer.

Well the ques. Gets easy if you know the HANGOVER no. :-) :-)lol

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...