add problem 6 to php, python, and ruby