Rail Fence Cipher

How did you reason about the fc-row-cycle indices ? That was really my blocker for making a general algo.