Averages/Pythagorean means

FCC link

Compute all three of the Pythagorean means of the set of integers $1$ through $10$ (inclusive).

Show that $A(x_1,\ldots,x_n) \geq G(x_1,\ldots,x_n) \geq H(x_1,\ldots,x_n)$ for this set of positive integers.

  • The most common of the three means, the [arithmetic mean](https://rosettacode.org/wiki/Averages/Arithmetic mean "Averages/Arithmetic mean"), is the sum of the list divided by its length:

    $ A(x_1, \ldots, x_n) = \frac{x_1 + \cdots + x_n}{n}$

  • The [geometric mean](https://en.wikipedia.org/wiki/Geometric mean "wp: Geometric mean") is the $n$th root of the product of the list:

    $ G(x_1, \ldots, x_n) = \sqrt[n]{x_1 \cdots x_n} $

  • The [harmonic mean](https://en.wikipedia.org/wiki/Harmonic mean "wp: Harmonic mean") is $n$ divided by the sum of the reciprocal of each item in the list:

    $ H(x_1, \ldots, x_n) = \frac{n}{\frac{1}{x_1} + \cdots + \frac{1}{x_n}} $

Test

{{test}}

Console output