Legendre's Formula determines the highest power of a prime p that divides n! by summing the quotients floor(n/p) + floor(n/p²) + floor(n/p³) + ... until the terms become zero. For example, the highest power of 3 in 100! is floor(100/3) + floor(100/9) + floor(100/27) + floor(100/81) = 33 + 11 + 3 + 1 = 48, meaning 3^48 divides 100!. The number of trailing zeros in n! equals the number of times 5 appears in its prime factorization, calculated as floor(n/5) + floor(n/25) + floor(n/125) + ...
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
IOQM_Pre RMO_Number Theory_day 5
Added:Good morning.
Okay, we'll start the exercise about concurrency and cyclicity usability rules.
Say the first question.
Number of integers n such that n by 20 - n is the square of an integer.
Square of an integer square of an integer. Number of n values for square of an integer.
Right? So n by 20 - n = 1² 2² 3² 4² and so on which are possible that we have to observe.
Okay.
Uh so n is how many integers we'll get like that.
So n = 20 - n into m² m² once observe here.
So, m² n + n = 20 m² n * m² + 1 = m² * 20 m² * 20.
So either n = m² or m² + 1 = 20 are some factors that we have to observe.
See suppose here n = 16.
n is = 16 16 by 20 - 16 16 by 4 = 4 which is 2² by using this n = m² case okay n = m² case uh square of an integer square of an integer see from here onwards five square onwards not possible because it it For here onwards 20 - n² less than 0 20 - n² less than 0 right and any more possible values are there once go through verify it right M² + 1 is equal 17 17.
See m² + 1 is = 17 uh 4² uh 3² 10 2² 5 then m² is equal to 17 - 1 16 10 - 1 9 5 - 1 4 so m is equal to 4 3 2 Okay if you'll take two here it is one it is one. Now verify it with all these verify with the all these. So what we'll get here suppose n by 20 - n = 4.
So 5n = uh 80 n = 16.
What we did here n - n by 20 - n = 3.
So, n = 60 - 4n 60 - 4n 60 - 3 n sorry so what we'll get here m² I'm sorry this is 4² square m² 4² so n = 16 - uh sorry uh 20 into 16 - 16 20 into 16 - 16 n. So 17 n is equal to that you have to verify n= 16 we'll get uh 4 which is 2² square which is uh 3² 9 what we'll get here n = uh 4 2² then n value 16 n = 80 - 4n 5 n is = 80 n = 16 uh if you'll take 9 here what we'll get here 9 3² n = 20 into 9 - 9 okay so n = 10 n is equal to see 20 into 9. So n is equal to 18. Once check with 18 18 by 20 - 18 18 by 2 that is 9.
uh n by 20 - n = 2² 3 square 4 square 16 what we'll get here n = 16 into 20 - 16 n okay so n = 17 n = 16 into 20 is not possible n by 20 - n = 1 1 square.
So what we'll get here n = 20 - n that is uh 2n = 2n = 20 n = 10.
So total n values required number of n values is equal to three. What are the three?
Uh n = 16, n= 18 and n = 10. For these three values, it is possible. Okay. Where did all of you write down?
Write down. Write down. Make it fast.
Next concept is write down highest power of highest power of highest power of a prime number P.
A prime number P contain in n factorial.
A prime number P in N factorial.
So n factorial is equal to 1 2 3 and so on product of first natural numbers continued product of first natural numbers. So in this n factorial n is n factorial is divisible by n factorial is divisible by p 2 p 3 p and and so on. Step n by p. This is a multiple of p integral part of n / p that is nothing but quotient when n divided by p quotient when n divided by p that is called integral part of P is also called step N by P.
Step N by P also called as step N by P.
Okay.
So like how many times will come will come here n by p. See in n factorial how many multiples are there? 1 2 3 and so on. N by p step n by mult p multiples are there in n factorial. step n by p multiples are there in n by p. So by using division algorithm by using division algorithm by using division algorithm.
So k of n factorial is equal to n / p step quotient plus k of step n by p factorial step n by p factorial k.
So this is all in n factorial. This is all in n factorial.
So k of step n by p factorial n by p by p step plus k of step n / p by p factor n / p² step plus k of step n by p² factorial.
In the same way k of step n by p² factorial it's division of algorithm is step n by p cq plus k of step n by p cq whole n by pq factorial.
If you'll conclude this and so on. So k of n factorial is equal to step n / p plus step n / p² and so on.
We'll continue up to zero. We have to continue this.
For example, if you'll see here, highest power of three in 100 factorial. That is the question.
Highest power of three in 100 factorial.
So how can we solve this? Highest power of three in 100 factorial. So simple. So p power e divides n factorial.
So e is equal to step n / p + step n / p² and so on.
So 3^ E divides 100 factorial that implies E is equal to step 100 by 3 plus step 100 by 3² + step 100 by 3 cube plus step 100 by 3 power 4 + 100 by 100 by 3 4 5 plus and so on.
Clearly it is nothing but quotient. It is nothing but quotient. So E is equal to what is the quotient here? 33.
Quotient is 33 plus see it's quotient 100 by 9 is equal to 33x 3. So 11 then it's quotient by 3 what is the quotient 3 3 is 9 plus by 3 1 + 0 until getting zero uh you have to continue the process. So now add all these 44 + 4 48. So 3^ 48 divides 100 factorial. This means 100 factorial divisible by 3 power 48 that's the required make it fast those who completed try to solve this Highest power of seven in,000 factorial that you have to solve. Highest power of 7 in,000 factorial.
H how many times? 164.
Very good. 164 be the required answer.
164 be the required answer. Good.
See the question in this concept is write down. The question in this concept is find the sum of digits of the largest positive integer n.
Find the sum of digits of largest positive integer.
largest positive integer n such that n factorial ends with n factorial ends with exactly 100 zeros.
Exactly 100 zeros.
Exactly 100 zeros.
See here if you'll take 10 factorial 10 factorial how many twos will come 2 e is equal to step 10 by 2 plus step 10x 2² plus step 10x 2 cube and so on. This is 5 by 2 2 by 2 1. So 2^ 8 * will come.
See 10 factorial is equal to 2^ 8 into 3x into see 5 power e 10 x 5 + 10 x 5² and so on. So 10 x 5 2x 5 0.
So 5² into 7^ y. So this is the prime factorization because less than 10 2 3 5 7 only prime numbers. So that it is right. So in 10 factorial 8 2's H two 5.
So now number of zeros how many?
So number of zeros nothing but number of 2 into fives. Number of two into fives. So number of two into fives how many will come here? See even though eight twos are there two fives are there. So two twos and two fives only considerable. Remaining six twos no need here. So it depends on number of zeros depends on number of fives.
Number of zeros nothing but number of fives. Got it all of you? Now see here in 100 factorial in 100 factorial.
So 100 by 5 step plus 100x 5² step plus 100 by 5 cube step and so on. So 100 x 5 20 + 20 x 5 4 + 4 x 5 0 quotients. These are quotients. So in 100 factorial how many fs are there?
In 100 factorial there are 24 fs.
So if you'll take into four into four 96 into 4 96 so let uh n factorial lit n = 400.
So 400 by 5 step + 400 by 5² + 400 by 5 cube + 400 by 5^ 4 plus and so on.
So 400 means 80 + 80 by 5 16 + 16 by 5 3 + 3x 5 0 then then uh 96 + 3 99 there will be 99 files but the question has it ends with exactly 100 zeros. It ends with exactly uh n = 4 5 4 6 4 7 4 8 4 9 H for all these same we'll get suppose 4 9 by 5 step plus 4 9 by 5² step plus 4 9 by 5 cube step plus 4 9 by 5^ 4 step what we'll get here 4 5 means 81 by 5 16 by 5 3 by 5 0 so this is exactly 100 so greatest n greatest n is equal to 4 9 what We required sum of digits of n = 4 + 0 + 9 which is 13 required.
So this is previous year question.
Okay, right solve it all of you make it fast.
Right down. Right down. Right down. Make it fast.
Right. See next question.
Find the number of positive integers of n such that find the number of positive integers n such that number of positive integers n such N such that f of n is equal to n + 2 n² + 3 nq + and so on + 2005 n^ 2005 is exactly divisible by is exactly divisible by n minus one.
So the total expansion is divisible by n minus one for how many n values? That is the question. Simple you know division algorithm. What is division algorithm?
f of n is equal to h f of n is equal to g of n into n -1 + k. It is a quotient It is a divisor.
It is a remainder.
It is remainder. So let n is = 1. Then f of 1 is = k because it becomes zero.
How we will get zero? g of 1 * 1 - 1 + k that is equal to k. So what is k here?
What is k here? 1 + 2 + so 1 + 205 because n= n in the f of n that is it is f of 1. So sum of first year natural numbers 2005 into 2006 by 2.
So k is equal to 205 into 1,003.
So this is 5 into 41. I think 41 is prime. Now which is div 1,00 3 divisible by we'll try with 7 1 3 because it is not divisible by 2 3 5 7 7 uh 14s 98 2 3 not possible 11 not possible 13 not possible uh 17 5 85 150 3 I think 9 153 so this is 17 into 53 these two also primes these two also primes now number of factors of K. So this is power one uh power 1 power 1 power 1. So 1 + 1 1 + 1 1 + 1 1 + 1.
So 16 factors are there. Now f of n is equal to g of n * n -1 + k.
So f of indiv k when divided by k divided by these 16 factors remainder zero remainder zero now this is all multiple of n minus one this is all multiple of so therefore number of required integers is equal to 60 I No chain.
Right.
See the next question.
What is sum of all the digits of largest positive integer n?
What is the sum of all digits of largest positive integer n such nq + 26 nq + 200 6 divisible by n + 26 divisible by n + 26 that is the question.
59 only. 59 only. Not 53.
This is 59 only. Sorry. 59 only.
59 only.
Good. Good. Good.
H see n cq + 206 must be divisible by n + 26.
So let it be in the form of aq + bq.
This is a + b * a² + b² - a b.
So it is uh if you write like this n² - 26 n + 26² 676 676 see h in this product n cq + 26 cq n cq + what is 26 uh 26 cq 676 into 26. Multiply multiply the product what we'll get in the product 17576 7 576. So if you'll observe in this product already what we have 2006.
So if you'll subtract 2006 from here 0752 sorry 07551 this is to be additional because 26 into 676 is this one but what we required only this one remaining no need remaining this one. So -1570 1 5 7 0 G all of you. Now see n cq + 206 is equal to n + 26 multiple minus this is also n + 26 multiple this one must be n + 26 multiple. So n + 26 multiple better to equate n + 26 what we'll get here.
So what is the sum of all digits of the largest positive integer? So n + 26 may be equal to 1 570 n= 24 26 means 44 1 54 is the maximum value. So therefore sum of digits 1 + 5 + 5 + 4 + 4.
So 10 + 15 + 4 19 be the required sum of digits.
So what we have to find maximum that's why understood all of you?
So this is already n + 26 multiple. It it is also n + 26 multiple nothing but equal to n + 26 multiple then we'll get this one maximum n value what we require.
Okay. What's the next question?
It is also find the smallest positive integer n such that find the smallest positive integer n such that smallest positive integer n such that n into n + 1 into n + 2 is divisible by 247.
Usable by 247. What is the question?
Right. Smallest positive integer n such that 247 is equal to see it is not divisible by two not divisible by three not divisible by five not divisible by 7 11 see we'll try with 13 13 into 13 1's 13 11 13 Okay. Now, so 13 19 13 19. So let 1 n + 1 n + 2 must be indivisible by 13 and another by 19 another by 19.
Okay. And uh and maximum difference what is the maximum difference here from these two modulus of b minus a is less than or equal to 2.
Suppose if you'll take 13 multiple here its difference is one its difference is two. If you'll take 19 multiple its difference is one and it difference is two. So the maximum difference of the two numbers is two. Okay. Uh let a is equal to ABR multiples. If you'll consider a multiples, if you'll consider m = 13, n = 19.
Then n = already n is given. Okay. But a = 13, b = 19. Here b = 19 into 1. B is equal to 19 into 1. If you'll take what we'll get here 19 into 1 19 into 1 see if you'll take 19 n + 2 19 n + 1 is 18 n is 17.
If you take this is 19 + 1 20 + 1 21 here there is no 13 multiple n= b suppose it is 19 19 - 1 18 19 - Maximum suppose n + 2 19 before that 2 18 17 if if n is 19 n + 1 20 n + 2 21 so b = 19 into 2 38 38 same so 38 max this is 37 this is 36 suppose 38 is At least 39 40.
39 is 13 multiple 39 is so among the values smallest. What is the least? Therefore, least n value is what is the least n value?
If you'll take uh find the smallest positive integer n such that if you'll take 37 37 37 + 1 37 + 2 which is 13 multiple uh 37 + 1 it is 19 multiple 19 into 2 this is 13 into 3. So the least value of n is 37.
Got it. All of you write down.
See how simple and beautiful questions are there here.
Before closing the session, I'll give one question. You can do it easily before closing the session. Okay. Try to solve this. The question is total number of zeros at the end of the value of the product.
Total number of zeros at the end of the total number of zeros at the end of the total number of zeros at the end of the product.
And end of the product 1 into 2 into 3 into 4 into and so on into 2008 is capital n.
Then roo<unk> n + 125 is what?
So we'll do homework this question because 5^ e divides 2008 factorial.
So E is equal to step 2008 by 5 plus step 2008 by 5² and so on. You'll get n value which is equal to n. So then you can find root n + 125.
Okay.
So today's class will conclude.
No. And uh today evening also there will be class 700 p.m.
to 8:30 p.m.
Evening class.
Okay. Thank you.
Write down the question.
Write down the question.
Related Videos

Definition:Bounded variation and if f is monotonic on [a,b] then f is Bounded variation on [a,b]
wingsofmathematicsbytanush2507
4K views•2019-09-05

Prof Chris Holmes | Bayesian fitting and evaluation of complex models arising in...
uclfacultyofpopulationheal9290
564 views•2019-07-03

Patrick Landreman: A Crash Course in Applied Linear Algebra | PyData New York 2019
PyDataTV
9K views•2019-11-30

Approximating the Standard Deviation from Data of a Histogram
donnasmith8529
15K views•2019-09-26

HSC Maths Standard 2 | "At Least One" Probability Rule
ATARNotesHSC
697 views•2019-05-20

Spectral Sequences Live! 17: The Grothendieck spectral sequence
k-theory8604
395 views•2025-11-10

Structural Equation Modeling for Beginners
QuantFish
1K views•2025-09-30

Exploring Practical Applications of Linear and NonLinear Models In Business Research Dr.Jeelan Basha
MallikarjunaDKaggal
258 views•2025-05-26
Trending

One Must Imagine Sisyphus Happy
vlogbrothers
61K views•2026-07-21

Future of Taylor Farms
maighstirtarot5385
11K views•2026-07-21

The Downfall of OnePlus!
techwiser
65K views•2026-07-21

My Friend Locked Up The Engine On His K-Swapped Bug...
boostedboiz
128K views•2026-07-21