Unlock these lockers

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?


The answer is 969.

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

Vedant Sharda
Jan 17, 2016

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

Arulx Z
Jan 17, 2016

Let τ ( n ) \tau \left( n \right) be the number of factors of a number n n . It's clear that if τ ( n ) \tau \left( n \right) is even, the locker will be closed while if it's odd, the locker will be open.

Let p i { p }_{ i } be the factors of n n . For a non-square number, p i { p }_{ i } can be divided in pairs -

p 1 p τ ( n ) , p 2 p τ ( n ) 1 { p }_{ 1 }{ p }_{ \tau \left( n \right) },\quad { p }_{ 2 }{ p }_{ \tau \left( n \right) -1 }\dots

Such that no numbers in any pair are equal. Hence the, for non-square numbers, τ ( n ) \tau \left( n \right) is even.

But in case of square numbers, there is exactly one case p a p b p_a \cdot p_b such that a = b 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 > 1000 32^2>1000 . Hence the number of non-square integers are 1000 31 = 969 1000-31 = 969 .

Moderator note:

Simple standard approach.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...