Since the sum of digits of an integer divisible by k−1, is divisible by k−1, too, (k−1)3 divides all the numbers obtained after the second step. (k−1)3. On the other hand, if a=anan−1…a0(k), n≥4 or a3≥2, n=3, then
a−(k−1)2(an+an−1+⋯+a0)≥2(k3−(k−1)2)−a1((k−1)2−k)−a0((k−1)2−1))≥2(k3−(k−1)2)−(k−1)(2(k−1)2−k−1)=5k2−2k−1>0.
This shows that we shall get a number of the form a=a3a2a1a0(k), where a3=0,1. The next number is
(k−1)2(a3+a2+a1+a0)≤(k−1)2(1+3(k−1))<4(k−1)3.
Hence this number is (k−1)3, 2(k−1)3 or 3(k−1)3. Note that
(k−1)3=k−3,2,k−1(k)→2(k−1)3,k>2,
2(k−1)3=1,k−6,5,k−2(k)→2(k−1)3,k>5,
3(k−1)3=2,k−9,8,k−3(k)→2(k−1)3,k>8.
Since 3.53=1423(6)→10.52=2.53, 3.63=1614(7)→12.62=2.63 and 3.73=2005(8)→7.72=73→2.73, we conclude that if k>5, then the numbers are equal to 2(k−1)3 from some point onwards.