This is a generalisation of "
The three sages"
On a hot summer day, n equally bright philosophers, tired from all that philosophising, were napping in an orchard. A prankster came by, and painted all of their faces black with charcoal.
When the philosophers woke up, they started laughing at the others... until they suddenly realised all of their faces must be black!
How did they come to that conclusion?
(In reply to
re(2): Is there something funny about a black face ? by Penny)
Right you are, Ms. Penny, but when you say that B would think "If my face is white, C is seeing two white faces, A's and mine, and one black face, D, and so he would conclude that his own face is black, and that is what D is laughing at ..." it follows that C would have stopped laughing (after all, who could laugh with a black face? nobody according to this puzzle!) but since C kept on laughing, therefore B's face had to be black.