project euler solved in swift