in reply to What should be an easy math question using %

Was the answer something like these?

my @first = map { 5 * $_ + 2 } 0..3; my @second = map { 5 * $_ + 3 } 0..3;
You can solve that sort os thing with gcd* of the differences between elements, and then % of any to find the additive part.

* greatest common divisor

After Compline,
Zaxo