sum series in swift