Yeah, I didn’t get that either.
Also, the secret code asked what lockers were “touched only twice.” But the uncle assumes you’re going to be smart enough to touch only the perfect squares. So no locker should be touched twice. (I guess it would take too many words to say “…would have been touched twice if every heir did their thing.”)
I don’t understand what you mean. The factors of 51 are 1, 3, 17 and 51. So it will be touched four times, leaving it closed.