Following Wigert, various authors, including Ramanujan, Gronwall, Erdős, Ivić, Schwarz, Wirsing and Shiu, determined the maximal order of several multiplicative functions, generalizing Wigert’s result
$$\begin{eqnarray}\max _{n\leqslant x}\log d(n)=\frac{\log x}{\log \log x}(\log 2+o(1)).\end{eqnarray}$$
On the contrary, for many multiplicative functions, the maximal order of iterations of the functions remains widely open. The case of the iterated divisor function was only solved recently, answering a question of Ramanujan from 1915. Here we determine the maximal order of
$\log f(f(n))$
for a class of multiplicative functions
$f$
. In particular, this class contains functions counting ideals of given norm in the ring of integers of an arbitrary, fixed quadratic number field. As a consequence, we determine such maximal orders for several multiplicative
$f$
arising as a normalized function counting representations by certain binary quadratic forms. Incidentally, for the non-multiplicative function
$r_{2}$
which counts how often a positive integer is represented as a sum of two squares, this entails the asymptotic formula
$$\begin{eqnarray}\max _{n\leqslant x}\log r_{2}(r_{2}(n))=\frac{\sqrt{\log x}}{\log \log x}(c/\sqrt{2}+o(1))\end{eqnarray}$$
with some explicitly given constant
$c>0$
.