Alternative solution for euler 22