#05AB1E, (削除) 26 (削除ここまで) (削除) 24 (削除ここまで) 23 bytes
Δ©ÅA®.2ÅAo®zÅAz®nÅAt)}н
Try it online or see the steps of all test cases.
-1 byte thanks to @Grimy.
23 byter alternative for Geometric mean:
Δ©P®gzm®ÅA®zÅAz®nÅAt)}н
Try it online or see the steps of all test cases.
Explanation:
Δ # Loop until the list no longer changes:
© # Store the current list in variable `®` (without popping)
# (which is the implicit input-list in the first iteration)
# Arithmetic mean:
ÅA # Builtin to calculate the arithmetic mean of the list
# Geometric mean:
®.2 # Take the base-2 logarithm of each value in the list `®`
ÅA # Get the arithmetic mean of that list
o # And take 2 to the power of this mean
# Harmonic mean:
®z # Get 1/x for each value x in the list `®`
ÅA # Get the arithmetic mean of that list
z # And calculate 1/y for this mean y
# Quadratic mean:
®n # Take the square of each number x in the list from the register
ÅA # Calculate the arithmetic mean of this list
t # And take the square-root of that mean
) # Wrap all four results into a list
}н # After the list no longer changes: pop and push its first value
# (which is output implicitly as result)
Kevin Cruijssen
- 136.2k
- 14
- 154
- 394