solution to euler  41/42.