Richard has 16 fair coins numbered 1 to 16 on one side and the other side is marked with 0. Richard tosses these 16 coins.
Let $X$ be the sum of the numbers on the coins.
What is the expected value of X?
It would make sense that it would be sum from 1 to 16 divided by 2, but I don't really understand why is that true formally.
By linearity of expectation, it is the sum of the expectation for each coin. Let's take a look at coin $i$ which has $i$ on one side and zero on the other. The expectation of this coin is $i/2$. Therefore, your intuition is correct, you simply sum from 1 to 16 and divide by two (which is the same as summing half of each summand)