Solution for project euler #2