A puzzle consists of a number of tiles, T, colored red on one side and blue on the other.

Start with all red side up. The goal is to get them all blue side up in the fewest number of rounds.

A round consists of flipping exactly N of them.

Find a rule for when the puzzle is impossible for given values of (T,N) with N≤T.

Find a rule for the number of rounds it will take when the puzzle is possible.

Let f(T,n) be the number of flips required.

When n = 5, it looks to me like

f(T,5) =

when T < 5 IMPOSSIBLE

When T = 6 6

When T = 7 5

When T = 8 4

Otherwise FLOOR(T/5) + MOD(T,5)

------------------------------------------

General Hypothesis (no proof), based on looking at N = 3 and 5

for n odd

when T < n IMPOSSIBLE

when T between n and 2n (noninclusive)

2n + 2 -T

Otherwise FLOOR(T/n) + MOD(T,n)