# Shuffling Magnets

For an experiment, I have to place magnets onto a rectangular board whose dimensions are 3 and 3.5 inches. Between each phase of the experiment, I have to shuffle these magnets around, but if two magnets get within 1 inch of each other, they'll stick together, and trying to separate magnets as strong as the ones I have is a real hassle. How many magnets can I place on a board such that I can switch any two without any sticking together? Other magnets can move, but they have to return to their original positions after the two are swapped.

I might be able to get as many as 13...

• I assume that, since you didn't mention the dimensions of these magnets, they're the rare 0"×0"×0" variety?
– Deusovi
Aug 13, 2020 at 4:09

This can be achieved placing the 15 magnets essentially on a square grid with one to spare. We can make all distances larger than $$1$$ by pulling columns slightly but not using all of the spare $$0.5$$ apart, slightly offsetting the first or last row and using the vertical wiggle room gained to pull the three other rows slightly apart.
We can now move like a 15 puzzle alternating between the top-row-offset, bottom-row-offset configurations as needed. To get around the 15 puzzle's parity constraint, move the gap to a corner, compressing the magnets to within an $$\epsilon$$ of a hexagonal packing that moves that corner as far as possible. Shift the row containing the gap back to the top/bottom edge, but leave its magnet opposite the gap where it is. This allows us to shift the rest of the row that crucial bit horizontally, nudging the distance between the two neighbors of the gap just above $$2$$. This permits to rotate the piece diagonally adjacent to the gap around the piece vertically adjacent to the gap into the gap's position, switching parity in the process. • Interesting! The numbers line up so perfectly to just above $2$. Making it a quite pretty puzzle. Aug 14, 2020 at 1:17