Solution of project euler #12