Although I can't answer all the questions, I can give you a nice pattern.

=number of mats

=the amount of turns, or flips, it takes

is rounded down to the nearest whole number

=the remainder of

This equation works with all numbers except for 4, which requires 4 turns.

I hope that helps a bit.