In olympiad teaching period, we have a session that students must try to design a good problem for others. Many times we arrive to good questions but sometimes there are some challenges. In one of our exam we gave this problem to our students:
Find the 5-digit numbers that the summation of the digits of their square is maximum? In the problem designing session, we got this problem (the notations are corrected and redefined. Also, I give here the generalized form of question):
Let $D_n^2(k)$ denotes the total number of $n$ digits number such that the summation of the digits of its square is less than or equal to $k$. What is the behaviour of $D_n^2(k)$?
I think this general form is so hard. Is the question famous or previously studied somewhere? Is there any approximation for the values of $D_n^2(k)$ based on $n$ and $k$?