If $n = n_0 + \dots + n_{t-1}10^{t-1}$ is nonnegative integer let's denote $$ S(n) = \sum_{k=0}^{t-1} n_k $$ $$ T(n) = \sum_{k=0}^{t-1} n_k^2 $$ It is well known that sequence $S(n), S(S(n)), \dots $ stabilizes to one-digit integer called digital root of $n$.
The sequence $T(n), T(T(n)), \dots$ needn't stabilize. It can be cyclic as, for example, with $n = 4$: $$ 4, 16, 37, 58, 89, 145, 42, 20, 4, \dots$$
Let's call the smallest number in sequence $T(n), T(T(n)), \dots$ "the squared digital root of $n$". While the ordinary digital root has pretty properties like $$dr(n) = \left\{\begin{matrix} 0, & n = 0\\ 9, & n \neq 0, n \equiv 0 \left(\text{mod} ~9\right)\\ n ~ \text{mod} ~ 9, & n \not\equiv 0 \left(\text{mod} ~9\right) \end{matrix}\right. $$ I wonder whether there's an efficient way to compute the squared digital root.
One obvious approach is to keep track of which numbers have occured so far and return the smallest of them when the repetition occurs. But such an algorithm will be too slow for big inputs. So is there a more mathematical approach like the one above?
EDIT
In a question Repeated sum of square of digits always arrives at $1$ or $89$ mentioned by @dhiv it's shown that sequence $T(n), T(T(n)), \dots$ will eventually end up in one of two cycles: $(1)$ or $(89,145,42,20,4,16,37,58)$.
This means that squared digital root of $n$ is not greater than $4$: $sdr(n) \leq 4$. But there's still a question: how to find which of this four numbers is the answer.