Comment

Comment by simonebrunozzi

I am not a math genius, but I spent a few minutes thinking about the locker problem.

It seems to me that:

1) Every locker essentially is open (let's say "1"), and it will switch to the other binary state ("0" from 1, or 1 from 0) a number of times.

2) The number of switches is based on number of factors that comprise that number, minus one. E.g. position 1 = zero switches. Position 2 = one switch. Position 3 = one switch. Position 4 = two switches. Position 5 = one switch. Position 6 = three switches. And so on.

Am I correct?

In case, the final result is something like: 100100001000000... Which is essentially 1 + a number of zeros equal to two, then four, then six, then eight, etc.

Edit: I've now continued reading the article and, well, the solution is down there. In a way, it seems I was correct.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton