Solution to euler 3.