J, 3734 bytes
(3431 as an expression without the assignment to variable f)
f=:1{(m&.:^.z,m&.:%%z,m&.:*:z,m=[z=:(+/%#)^:_
1{ Take the element #1 of
( the function
m&.:^. {do "m" under natural logarithm}
,m&.:% {do "m" under inversion}
,m&&.:*: {do "m" under square}
,m=:+/%# {do "m"} - where m = arithmetic mean
)^:_ applied infinitely many times
For functions a and b, a &.: b ("a under b" (related challenge)) is equivalent to (b inv) a b -- apply b, then a, then inverse of b. In this case, geometric/harmonic/quadratic mean is the arithmetic mean "under" logarithm, inversion, and square respectively.
J, 37 bytes
(34 as an expression without the assignment to variable f)
f=:1{(m&.:^.,m&.:%,m&.:*:,m=:+/%#)^:_
1{ Take the element #1 of
( the function
m&.:^. {do "m" under natural logarithm}
,m&.:% {do "m" under inversion}
,m&.:*: {do "m" under square}
,m=:+/%# {do "m"} - where m = arithmetic mean
)^:_ applied infinitely many times
For functions a and b, a &.: b ("a under b" (related challenge)) is equivalent to (b inv) a b -- apply b, then a, then inverse of b. In this case, geometric/harmonic/quadratic mean is the arithmetic mean "under" logarithm, inversion, and square respectively.
J, 34 bytes
(31 as an expression without the assignment to variable f)
f=:1{(^.z,%z,*:z,[z=:(+/%#)&.:)^:_
For functions a and b, a &.: b ("a under b" (related challenge)) is equivalent to (b inv) a b -- apply b, then a, then inverse of b. In this case, geometric/harmonic/quadratic mean is the arithmetic mean "under" logarithm, inversion, and square respectively.
J, 37 bytes
(34 as an expression without the assignment to variable f)
f=:1{(m&.:^.,m&.:%,m&.:*:,m=:+/%#)^:_
1{ Take the element #1 of
( the function
m&.:^. {do "m" under natural logarithm}
,m&.:% {do "m" under inversion}
,m&.:*: {do "m" under square}
,m=:+/%# {do "m"} - where m = arithmetic mean
)^:_ applied infinitely many times
For functions a and b, a &.: b ("a under b" (related challenge )) is equivalent to (b inv) a b -- apply b, then a, then inverse of b. In this case, geometric/harmonic/quadratic mean is the arithmetic mean "under" logarithm, inversion, and square respectively.
J, 37 bytes
(34 as an expression without the assignment to variable f)
f=:1{(m&.:^.,m&.:%,m&.:*:,m=:+/%#)^:_
J, 37 bytes
(34 as an expression without the assignment to variable f)
f=:1{(m&.:^.,m&.:%,m&.:*:,m=:+/%#)^:_
1{ Take the element #1 of
( the function
m&.:^. {do "m" under natural logarithm}
,m&.:% {do "m" under inversion}
,m&.:*: {do "m" under square}
,m=:+/%# {do "m"} - where m = arithmetic mean
)^:_ applied infinitely many times
For functions a and b, a &.: b ("a under b" (related challenge )) is equivalent to (b inv) a b -- apply b, then a, then inverse of b. In this case, geometric/harmonic/quadratic mean is the arithmetic mean "under" logarithm, inversion, and square respectively.
J, 37 bytes
(34 as an expression without the assignment to variable f)
f=:1{(m&.:^.,m&.:%,m&.:*:,m=:+/%#)^:_