Based on my N=1 survey and despite what it says below, I suspect this will actually be fairly easy even for some readers with advanced degrees. Still, I like this problem. To make it more interesting, see how many examples you need to deduce the algorithm.
I grabbed this off Google+. For some reason, when I went back a second time (just moments later) to try to find who posted it, I couldn’t re-find it. So, apologies for not citing the source.