Assign the colors numbers from 0 thru K-1.
Person(N) sums up the colors of all the people in front of him modulo K,
and announces the corresponding color. He will survive with probability 1/K.
Person(N-1) also sums up the colors in front of him modulo K
and then subtracts the color announced by person(N) (again modulo K).
He survives!!
Repeat!