Groovy version of euler2, tail-recursion