Definition
Given positive integers $a,b$, with $a>1$, let $D(a,b)$ be the sum of the base-$a$ digits of $b$.
In other words
Rearranging, we get: $b = r_{l} a^l + ... + r_2 a^2 + r_1 a^1 + r_0 a^0 $.
the sequence of $l+1$ digits $(r_{l}, ..., r_2, r_1,r_0)$ is the representation of the non-negative integer $b$ in base $a$, and so $D(a,b) =r=$ the digit sum in this base-$a$ representation.
Problem
Let $n\in \mathbb{Z_{\ge 2}}$,$k\in \mathbb{Z_{\ge 0}}$ and $m\in \mathbb{Z_{\ge 1}}$
Show that
$$D(n,(n+k)^m)=(k+1)^m$$
$$\forall n \ge k^{m-1}\binom{m}{\lceil \frac{m}{2} \rceil}+1$$
Example
Take $k=2$ and $m=3$
So $ k^{m-1}\binom{m}{\lceil \frac{m}{2} \rceil}+1=13$
Now choose any $n\ge 13$
Gives $D(n,(n+2)^3)=27$
And digits represention is also constant
$(n+2)^3=(1,6,12,8)_n \forall n \ge 13$
Python programming for calculate $D$ function.
n1=16
n2=18**3
rem_array = []
while n2 != 0:
mod = n2%n1
if mod != 0:
rem = mod
n2 = n2 - rem
rem_array.append(round(rem))
n2=n2/n1
else:
n2 = n2/n1
rem_array.append(0)
print(rem_array[::-1])
print("D(n1,n2)=",sum(rem_array))
Actually you also need this additional condition:
$$ n > k^m$$
E.g. consider $k=5, m=2$, then your condition says $n \ge 5\times 2 + 1 = 11$, but $(n+k)^m = n^2 + 10 n + 25$ so the base-$11$ digits are $(1,10,25) \to (1,12,3) \to (2, 1, 3)$ and $D = 6$ but $(1+k)^m = 36$.
If we have the additional condition, then in the binomial expansion of $(n+k)^m$ the terms do not "carry over" from one power of $n$ to the next power of $n$. I.e.
$$(n+k)^m = \sum_{j=0}^m {m \choose j} n^j k^{m-j} = \sum_{j=0}^m a_j n^j$$
where $a_j = {m \choose j} k^{m-j}$ and $a_j < n$ for any $j$. To see that for $j \ge 1$:
It is well known that the central binomial coefficient is the largest one in that row, i.e. ${m \choose \lceil m/2 \rceil}\ge {m \choose j}$
$k^{m-j} \le k^{m-1}$ when $j \ge 1$.
Meanwhile my additional condition also makes $a_0 = k^m < n$.
Now because $a_j < n$ for all $j$, this means $a_j$ is actually the $j$th digit in the base-$n$ notation of $(n+k)^m$. So the sum of digits is:
$$D(n, (n+m)^k) = \sum_{j=0}^m a_j = \sum_{j=0}^m {m \choose j} k^{m-j} = (1+k)^m$$
where the last equality is based on the binomial expansion of $(1+k)^m$ itself.