Based on the definition of the arithmetic mean. AM between two non-consecutive terms $x_1$ and $x_2$ of the AP sequence is the following $$\frac{x_1 + x_2}{2}$$
But I'm a little confused on how this formula extends to the more general cases like the following mean(or average) $$\frac{x_1 + x_2 + x_3 + ...+ x_n}{n}$$
In creating a mean statistic, we want to come up with a "representative" value $\mu$ for a data set. This can be done in many ways. For example, we could come up with a value that, given a set of numbers $x_i, i = 1, 2, \ldots, n$, minimizes the "total signed distance from $\mu$" $$ D = \sum_{i=1}^n (x_i - \mu) $$ Other definitions could use the absolute value, or squaring the quantity in parentheses. In this case it turns out that you can get $D$ to be exactly zero and I think we can be pretty happy with that. Then $$ \sum_{i=1}^n (x_i - \mu) = 0 $$ Opening the parenthesis gives us $$ \underbrace{\sum_{i=1}^n x_i}_{\text{sum of all entries}} - \underbrace{\sum_{i=1}^n \mu}_{=n \mu} = 0 $$ and therefore $$\mu = \frac{\text{sum of all entries}}{n}$$ In case of just two entries, the formula becomes simply $$ \mu = \frac{x_1 + x_2}{2} $$