Proof for form of terms A372010 Michael S. Branicky, Apr 16 2024 Theorem. a(n) = 1 0^{n-1-h} 9^h, where h = floor(n/2) and ^ represents repeated concatenation. Proof. Let k = sum_{i=0}^{n-1} d_i 10^i. Then R(k) = sum_{i=0}^{n-1} d_i 10^{n-1-i}. Let F(k) = R(k)/k, The partial derivative of F(k) with respect to d_i is p_i = [ k 10^{n-1-i} - R(k) 10^i ] / k^2. For n-i >= i, we have p_i > 0 since k 10^{n-1-i} k = 10k 10^{n-i} > R(k) 10^i, where the latter is valid since R(k) < 10 k. Thus, F(k) is maximized by maximizing d_i while n - i >= i or n >= 2i, which means setting d_i = 9 for n >= 2i. For this part, we may assume R(k) > k in our maximization. However, we will only use R(k) > k/10. When 2i > n, we have 10^(2i) R(k) > 10^{n} R(k) > 10^n (k/10), 10^i R(k) > 10^{n-i} k > 10^{n-1-i} k. Thus, p_i is decreasing with d_i and we need to minimize d_i, which means setting d_{n-1} = 1 and all others to 0 for i > n/2. #