Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAReally cool it's all the square numbers that are open!
Fun challenge. I'm interested in why the resulting "open" lockers have the values that they do. Some very neat mathematics going on behind the scenes here.
This challenge was excellent practice! Lots of ways to solve this problem.
When I first considered this challenge, I thought of it a BATCH macro scenario. My logic for a batch macro was based on the locker number - only student numbers that are a factor of a locker number would touch that locker; in the end, lockers with an even number of factors would be left open.
Then I realized that this could also be solved without a macro, using APPEND to create a cross-product of students and lockers. But that could get big with lots more lockers.
Finally, I saw others used ITERATIVE macros, so I did that too for practice - I am intimidated by iterative macros, but this was the easiest iterative macro ever.