add problem 21 to php, python, and ruby