I'm reading Kees Doets's Basic Model Theory and couldn't get around the first exercise, which is rather simple (no doubt my lack of arithmetical skills played a part). Let $t$ be a term and let $n_i$ ($i = 1, 2, 3, \dots$) be the number of $i$-ary function symbols that occur in $t$. The exercise is to provem by term induction, that the number of variables and constants in $t$ is $1+\sum_i(i-1) n_i$, that is, $1 + n_2 + 2n_3 + \dots$.
The base case is obvious. As for the induction step, suppose $t$ is $f(t_1, \dots, t_k)$. The induction hypothesis hold for each $t_l (1 \leq l \leq k)$, so we know that, for each such $t_l$, the above formula holds. Further, we know that the number of variables and constants in $t$ is the sum of the number of constants and variables in each $t_l$ (right?). Here comes my problem: doesn't that result in the number $k + \sum_i(i-1)n_i$? Where did I go wrong? It's probably something very simple, but I couldn't figure out what, exactly, is the problem.
Ihe number of occurrences of $k$-ary function symbols in $f(t_1,\dots,t_k)$ is $1$ more than the sum of the numbers of occurrences of $k$-ary function symbols in the $t_i$.
More formally, if $n_k$ is the combined number of occurrences of $k$-ary function symbols in the $t_i$, then the number $n'_k$ of occurrences of $k$-ary function symbols in $f(t_1,\dots,t_k)$ is given by $n'_k=1+n_k$.
In the formula, the summand $(k-1)n_k$ becomes $(k-1)n'_k$, that is, $(k-1)+(k-1)n_k$.
That yields an additional $k-1$ in the sum, and your $k$ in front is $1+(k-1)$.