>>11739388you literally continue in this fashion. This method works to sum the first n numbers, for any n.
If n is even, then we can evenly split the list into the first n / 2 and then the latter n / 2 numbers. If we add 1 and n, we get n + 1. If we add 2 and n - 1, we get n + 1. We can make n / 2 such pairs, and so we get n(n + 1) / 2 as our total sum.
If n is odd, then we have a middle element that is bigger than (n - 1) / 2 but smaller than (n + 1) / 2. Make pairs as we did in the case where n was even until we pair up (n - 1) / 2 and (n + 1) / 2. Then, we add the middle number, and we find we have the exact same formula. This case is a little extra arithmetic, but it's the same answer.
Alternatively if you don't see this intuitively, just use induction.