solution for euler 55.