A school corridor has 100 lockers numbered 1 to 100, all closed. Only the students with odd numbers take part: student 1 toggles every locker, student 3 toggles every locker whose number is a multiple of 3, student 5 toggles every multiple of 5, and so on up to student 99 (each toggle opens a closed locker or closes an open one). After all fifty students have passed, how many lockers are open?
Enter an integer
Show solution
Locker n is toggled once for each odd divisor of n, so it ends open exactly when n has an odd number of odd divisors. Write n=2am with m odd; the odd divisors of n are the divisors of m, and m has an odd number of divisors exactly when m is a perfect square. So we count n≤100 of the form 2ak2 with k odd: k=1: 1,2,4,8,16,32,64 (7); k=3: 9,18,36,72 (4); k=5: 25,50,100 (3); k=7: 49,98 (2); k=9: 81 (1). Total 7+4+3+2+1=17.