There are 1000 lockers (initialy all are closed) and 1000 students in a school. Teacher ask the 1st student to go to each locker and open it , then the teacher ask 2nd student to go to every 2nd locker and close it , 3rd student to go to every 3rd locker if close then open or open then close it and the same goes on till 1000th student.
How many lockers are closed at last?
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.
Let τ ( n ) be the number of factors of a number n . It's clear that if τ ( n ) is even, the locker will be closed while if it's odd, the locker will be open.
Let p i be the factors of n . For a non-square number, p i can be divided in pairs -
p 1 p τ ( n ) , p 2 p τ ( n ) − 1 …
Such that no numbers in any pair are equal. Hence the, for non-square numbers, τ ( n ) is even.
But in case of square numbers, there is exactly one case p a ⋅ p b such that a = b . Therefore, the number of factors are odd.
So, we just need to calculate the number of non-square numbers from 1 to 1000. We know that there are 31 square numbers below 1000 because 3 2 2 > 1 0 0 0 . Hence the number of non-square integers are 1 0 0 0 − 3 1 = 9 6 9 .
Simple standard approach.
Problem Loading...
Note Loading...
Set Loading...
On 1st locker 1st student come.
On 2nd locker 2nd student come.
So on 3rd locker factor of 3 will come. Even factors : Closed Odd factors : Open (numbers with odd factors are perfect) 31 perfect square are there in between 1 to 1000
so 31 open lockers
and 1000-31=969 are closed lockers