Remix this project. The challenge and rules are inside. I figure I ought to give this a shot myself. ;) It should work correctly for any number, but if you catch any mistakes, let me know.