Solution to number 6 of project euler