Solution to euler54.