Thursday, July 25

Solution of Baap of Challenger

     There are how many integers "n" in  between 1 and 10^7, including both,  such that last 7 digits of n and n^3 are the same? (If n or n^3 has fewer than 7 digits, then add 0s in the left and then compare the last 7 digits.)
      
      a. 10                b. 15                c. 20                d. None of These



Sol [b]
If last 7 digits of n and n^3 are the same it means n^3 - n is divisible  10^7
i.e (n-1)*n*(n+1) is divisible by 10^7                   [n^3 - n=(n-1)*n*(n+1)]
It shows (n-1)*n*(n+1) is divisible by both 2^7 & 5^y

Case I: (n-1)*n*(n+1) is divisible by 2^7
Sub-case a : If n is even than both  (n-1) & (n+1)are odd so n should be divisible by 2^7
=> n is multiple of 2^7.......................(i)
=>n = 2^7, 2*2^7,.........,5^7*2^7

Sub-case b : If n is odd than (n-1)*(n+1) should be divisible by 2^7
Since the gap between n-1 and  n+1 is 2 so one of them is divisible by 4 and other is by only 2

Sub-case b1 : Let n-1 is divisible by 2 but 4 , then n+1 is divisible by 2^6 => (n+1) is multiple of 2^6
=> n = 2^6 -1 , 2*2^6 -1, 5^7*2^6 -1 .....5^7*2*2^6 - 1

Sub-case b2: Let n+1 is divisible by 2 but 4 , then n-1 is divisible by 2^6 => (n-1) is multiple of 2^6
=> n = 1, 2^6 +1 , 2*2^6 +1, 5^7*2^6 +1 .....

Sub-case b3 : Let n-1 is divisible by 2^7 => (n-1) is multiple of 2^7

Sub-case b4 : Let n+1 is divisible by 2^7 => (n+1) is multiple of 2^7

So we can say we are getting 5 different remainders for "n" when divided by 2^7 which are 0, 1, 2^6-1, 2^6+1 & 2^7 -1
Case II: (n-1)*n*(n+1) is divisible by 5^7
Sub-case (i) : n-1 divisible by 5^7 => n = k*5^7 +1
Sub-case (ii) : n divisible by 5^7 => n = k*5^7
Sub-case (iii) : n+1 divisible by 5^7 => n = k*5^7 -1

So we can say we are getting 3 different remainders for "n" when divided by 5^7 which are 0, 1, -1

There are three possible values of  remainders by 5^7 and five possible values by 2^7 . Then by the CRT (Chinese Remainder Theorem) there are 15 possible values of remainder by 10^7.

Hence there are 15 required solutions of  n in between 1 to 10^7.

No comments:

Post a Comment