A magnetic torque limiter is a device to protect mechanical equipment from damage from overload. It can be constructed using two concentric rings, holding magnets facing each other. The transferred torque is limited by the attraction force of the pairs of magnets. If the load gets too high or the mechanism gets stuck, the torque limiter will slip instead of break.
Additionally, the torque limiter can be made to preferentially lock when the two axles align by carefully choosing the positions of magnets. In the aligned position, every pair of magnets is engaged but at most one pair can be engaged otherwise, thus maximizing the difference in torque limit for the aligned versus unaligned positions. As long as the load is higher than the strength of a single magnet pair, the torque limiter will keep slipping until the aligned position is reached.
In the illustration below, each ring has 7 slots for magnets, and 3 slots are filled. The inner circle drives the outer circle, with a torque limited between the strength of 1 and 3 magnet pairs. When the outer ring is blocked briefly the mechanism disengages and doesn't reengage until all 3 magnets are aligned after a full turn.
Click/tap to start or stop the animation.
Your task is to evaluate whether a pattern of filled/missing magnets fulfills the torque limiter description above. Each pattern can be described by a sequence of 1 and 0 representing present and absent magnets in the slots around the perimeter of the torque limiter. 1101000 represents the illustration above and is a valid pattern.
In contrast, 111000
is not a valid pattern because when offset by 1 in either direction, two pairs of magnets will attract each other and perhaps engage the mechanism if the load is sufficiently low.
Each line of your input has the serial number and the magnet pattern of a proposed torque limiter, but not all of them are valid. For example, in the list below, serial numbers 11 and 12 represent valid patterns.
What is the product of all valid serial numbers modulo 1010000010001?
Copied!Couldn't copy the data or view the input data.
(You must solve part 1 before continuing.)
Coda
Placeholder for the coda.