APL (Dyalog Unicode), 22 15 bytes
Anonymous tacit prefix function implementing $$f(x)=x_1\cdot\big[1=\lvert x\rvert\big]+\sum_{n=1}^{\lvert x\rvert}1^{\lvert x\rvert-n}\cdot\lvert x\rvert^{x_n}$$$$f(x)=x_1\cdot\big[1=\lvert x\rvert\big]+\log_{\lvert x \rvert} \sum_{n=1}^{\lvert x\rvert}1^{\lvert x\rvert-n}\cdot\lvert x\rvert^{x_n}$$
(⊃×1=≢)+≢⍟1⊥≢*⊢
(
⊃
the first element
×
times
1=
whether (1) or not (0) one equals
≢
the length of the argument
)+
plus
≢⍟
the length-logarithm of
1⊥
the sum (lit. the base-one evaluation) of
≢
the length
*
raised to the power of (each element in)
⊢
the argument
Old solution: APL (Dyalog Extended), 22 bytes
Anonymous prefix lambda.
{0::1+⊃⍵⋄+/⍢((≢⍵)∘*)⍵}
{
…}
"dfn"; argument is ⍵
0::
if any error happens:
1+
increment
⊃⍵
the first element of the argument
+/⍢(
…)⍵
the sum of the argument, under the influence of:
(
…)∘*
raising to the power of:
≢⍵
the tally of elements (length of the argument)