How it works
Measure complete central repeats in a finished, appropriately blocked swatch, excluding edges. A stretched starting chain is not the finished width. Repeat width = measured swatch width ÷ complete repeats. Compare floor and ceil of (target width − combined edge width) ÷ repeat width. Starting chains = m × repeats + a, exactly as your pattern specifies.