That is actually a rather clever solution. I guess you could do the same in Python, using itertools.
That said, I guess I should rephrase my question: Is there a simple programming test that can help weed out fakers quickly, which does not involve mathematics? Sort of like "Deploy a simple CRUD app in 15 mins" or something?
This is to address the parent's concern that a lot of web apps out there don't actually require much mathematics.