Posts

practice problems pending

Image
Q. How many non-negative integers can be written in the form: a7.3^7 + a6.3^6 ... a0.3^0 where a_i belongs to {-1,0,1} for i = 0 to 7 Solution: Let's say all a_i are 1 Then it's a GP: 3^7 + 3^6 .. 3^0 Sum = 1 * (3^8 - 1)/3-1 = (3^8 - 1)/2 So this is the max value of this expression. Similarly the min value will be: -(3^8 - 1)/2 So total possible integers in the min to max range =  (3^8 - 1)/2 - - (3^8 - 1)/2 + 1 = 3^8 - 1 + 1 = 3^8 Now, let's compute how many total ways are there to choose all possible combinations of a_i? Each a_i can be chosen in 3 different ways so 3^8. Aha! So number of ways to choose all a_i is same as the min to max range. So there is a one to one mapping. So non negative integers are (3^8 - 1)/2 + 1  Q. a1 + a2 ... a2018 = 2018^2018 Then what is the remainder by 6 of a1^3 + a2^3 ... a2018^3 Solution: For any integer n = n^3 mod 6 You can try all the cases when remainder of n by 6 is 0,1,2,3,4,5 you will get back same remainder for n^3. So r = 2018^20...

Chinese remainder theorem - pending

 How do you find 'x' s.t. x = 3 mod 11 x = 4 mod 7 x = 1 mod 5 First check that 5,7,11 are pairwise co-prime. Done. Then we write 'x' as sum of 3 numbers in a way that 2 of them disappear when taking mod by any of 5,7,11 So x = a.7.11 + b.5.11 + c.5.7 If I do x mod 5, I will get a.7.11 mod 5 and rest 2 numbers will disappear. Same for 7 and 11. Now I need to ensure that a.7.11 mod 5 = 1. For this we do trial and error and start with a = 1 a.77 mod 5 = a.2 mod 5 = 1 => a = 1,2 doesn't work. a = 3 works. b.55 mod 7 = 4 => b.6 mod 7 = 4 => b = 3 c.35 mod 11 = c.2 mod 11 = 3 => c = 1,2,3,4,5,6 don't work. c = 7 So x = 3.77 + 165 + 245 = 231 + 410 = 641 Test 641 mod 5 = 1 641 mod 7 = 4 641 mod 11 = 3 So it works. But there are multiple such solutions. They are of the form: 641 + lcm(5,7,11).k = 641 + 385k And smallest positive value would be 641 - 385 = 256

practice problems

 Q1. aabb is a 4 digit number and a square. find it. n = aabb = 1100a + 11b = 11(100a + b)  => 100a + b = 11k for 'n' to be a squre. a = 1 to 9 b = 0 to 9 a = 1, b = 0-9 => range = 100 to 109 , nothing here divisible by 11. a = 2,3... will give us these numbers divisible by 11: 209 308 407 506 605 704 803 902 When we divide them by 11, we should get a square. It happens only with 704 = 11*64 So the answer is 704*11 = 7744 Q2. Find all positive integers n less than 1999 such that n^2  is equal the cube of the sum of n's digits. Solution: n^2 = s^3 => s is also a square. Let s = m^2 => n^2 = m^6 => n = m^3 So iterate over all cubes < 1999 => 1 <= m <= 12 m = 1 => m^3 = 1 => n = 1 s = 1 n^2 = s^3 True m = 3 => m^3 = 27 = n => s = 9, s^3 = 729 = n^2 = 27^2 True No other number works Answer n = 1,27

Practice problems - not clear

Q. Show that we any integer 'n' can be expressed as: a.sqrt(2) + b.sqrt(3) where a,b are also integers. This can be solved using Kronecker’s Approximation Theorem somehow.

Pending - Proof of multiplicative property of Euler's Totient function using Combinatorics inclusion exclusion principle

Let's take an example. n = 10 Prime factors; 2,5 To find Phi(10) We do 10 - 10/5 - 10/2, basically subtract all numbers divisible by one of the prime factors. But that would cancel out the number 10 twice since it's divisible by both 2,5. So we add that again. It can be written as: n - n(1) + n(2) Where n(1) = numbers divisible by 1 prime factor. n(2) = numbers divisible by 2 prime factors. In this case: 10 - 10/5 - 10/2 + 10/10 = 10 - (7) + 1 = 4 which is indeed correct. 1,3,7,9 are co prime to 10. To make it general: Let n = p1^a1 * p2 ^ a2 ... pk ^ ak Phi(n) = n - n(1) + n(2) - n(3) ... (-1)^k.n(k) where k is the number of prime factors of n. = n - (n/p1 + n/p2 .. n/pk) + Sigma(n/p_i.p_j) ... = n [1 - sigma(1/p_i) + sigma(1/p_i.p_j) - ...] = n (1 - 1/p1) (1 - 1/p2) ..(1-1/pk) Now let m = q1^a1 * q2 ^ a2 ... qk1 ^ ak1 And let gcd(m,n) = 1 i.e. they are coprime. So no common factors. Phi(m) = m (1 - 1/q1) (1 - 1/q2) ..(1-1/qk) And Phi(mn) = mn (1 - 1/q1) (1 - 1/q2) ..(1-1/qk) ...

Practice problems 1 - pending

Q1. Consider the equation ab + bc + ca = abc - a - b - c. Is it necessary for all of a,b,c to be even? Solution: Yes. Consider the cases one by one when it is not so. Case 1: All odd. Rewrite the equation like this: a(b+1) + b(c+1) + c(a+1) = abc RHS = odd LHS = even + even + even = even Not possible. Case 2: a,b odd. c even. WLOG Rewrite the equation like this: a(b+1) + b(c+1) + c(a+1) = abc RHS = even LHS = even + odd + even = odd Not possible. Case 3: a odd. b,c even. WLOG Rewrite the equation like this: a(b+1) + b(c+1) + c(a+1) = abc RHS = even LHS = odd + even + even = odd Not possible. So we have checked all cases: 1 odd, 2 odd, 3 odd. None of them works. Only option is all even. Q2. Sum of all divisors of a natural number? Q3. If last 2 digits of 107n and n are same then what is the smallest value of n? Solution: 107n = n mod 100 => 106n = 0 mod 100 => 6n = 0 mod 100 => 6n = 100k => 3n = 50k => n has to be a multiple of 50 since 3 is not. So smallest n = 50. Q4....

Legendre's Formula with a sample problem - pending

Q. Find the number of values of \( n \in \mathbb{N} \), such that that the largest exponent of 2 dividing \( n! \) equals \( n \). 1. The Formula Legendre's Formula states that the largest exponent of a prime \( p \) dividing \( n! \) (denoted as \( v_p(n!) \)) is given by: \[ v_p(n!) = \sum_{k=1}^{\infty} \left\lfloor \frac{n}{p^k} \right\rfloor \] An alternative and very useful form of this formula relates the exponent to the sum of the digits of \( n \) when written in base \( p \): \[ v_p(n!) = \frac{n - s_p(n)}{p - 1} \] where \( s_p(n) \) is the sum of the digits of \( n \) in base \( p \). 2. Solving the Problem The problem asks for the number of values of \( n \in \mathbb{N} \) such that \( v_2(n!) = n \). Step 1: Apply the formula for \( p = 2 \) Using the second form of Legendre's Formula: \[ v_2(n!) = \frac{n - s_2(n)}{2 - 1} = n - s_2(n) \] Step 2: Set up the equation According to the problem statement, we need \( v_2(n!) = n \). Substituting our formu...