Radio Astronomy Systems Research Group

Log In
Home Sitemap Recent Changes Media Manager

Trace: answer

wiki:donuts:winter2015:lockers:answer

Answer

There will be 10 lockers left open: #1, #4, #9, #16, #25, #36, #49, #64, #81, and #100.

For any locker k, you will visit that locker on any pass n which happens to be a factor of k (i.e. you will visit #12 on passes 1, 2, 3, 4, 6, and 12). Because factors always come in pairs, you should visit each locker an even number of times. However, numbers which do not have an even number of unique factors may be visited an odd number of times. For locker #9, the factors are 1, 3, 3, and 9. When you get to that locker on pass number 3, you will toggle it only once, so now that locker has an odd number of visits which means it will be left open at the end. It turns out that square numbers all have an odd number of unique factors so they will all be left open at the end.

wiki/donuts/winter2015/lockers/answer.txt · Last modified: 2015/01/21 12:39 by jmb438