Given two positive integers a,b in decimal representation, we say a contains b if a can be obtained from b by adding some digits on the right. We first prove a lemma.
Lemma Let n1,n2,...,nr be pairwise distinct positive integers with digit 1 or 2. If none contains another, then the number of ni's with S(ni)≤t is at most Ft, where t is an arbitrary positive integer and Ft is a Fibonacci number satisfying F1=1,F2=2,Fn+2=Fn+1+Fn (n≥1).
*Proof of lemma.* We induct on t. It is clear for t=1,2 (when t=2, 1 and 11 cannot both appear). Suppose that the lemma is true for all positive integers less than t (t≥3); we shall prove that it is also true for t. Suppose that without loss of generality S(n1),S(n2),...,S(nl) are all the numbers with the sum of digits ≤t, where n1,n2,...,nj start with 1 and nj+1,nj+2,...,nl start with 2. If one of n1,n2,...,nj is 1, then j=1≤Ft−1, otherwise by deleting the first digit of n1,n2,...,nj we obtain j positive integers with none containing another and the sum of digits ≤t−1, and thus we again have j≤Ft−1 by the inductive hypothesis. Analogously, we have l−j≤Ft−2. And therefore l≤Ft−1+Ft−2=Ft, i.e. the lemma is also true for t. The proof of the lemma is completed.
Going back to the original problem, we consider a more general question. Replacing 26 by m, denote the least possible value of ∑i=1mS(ni) by f(m). Fix m≥3, and let n1,n2,…,nm be a set of numbers satisfying the conditions in the problem which attains the minimum f(m). Without loss of generality, assume that max1≤i≤mS(ni)=S(n1) and n1 is maximum among all these numbers attaining the maximum digital sum. Since m≥3, n1 contains at least two digits.
If the last digit of n1 is 1, replace n1 by 10n1−1, which is not one of n2,n3,…,nm, otherwise n1 would contain some ni. Notice that 10n1−1,n2,…,nm again satisfy the conditions in the problem, for if ni contains 10ni−1 for some i≥2, then S(ni)>S(n1) and ni>n1, a contradiction. Now
S(10n1−1)+S(n2)+⋯+S(nm)=f(m)−1,
a contradiction to the definition of f(m). Thus, the last digit of n1 is 2.
If n1−1 is not one of n2,n3,…,nm, replace n1 by n1−1, and these m numbers again satisfy the conditions in the problem, for if ni contains ni−1 for some i≥2, then ni must be 10(ni−1)+1, S(ni)=S(n1); however, ni>n1 is a contradiction to the choice of n1. Now
S(10n1−1)+S(n2)+⋯+S(nm)=f(m)−1,
a contradiction to the definition of f(m). Thus, n1−1 appears in n2,n3,…,nm.
Without loss of generality, assume that n2=n1−1. Consider 10n1−2,n3,…,nm; since 10n1−2=ni for i≥3, these are m−1 pairwise distinct numbers. There is no containment among n2,…,nm, and 10n1−2 does not contain any of n3,…,nm, otherwise n1 would contain that number. If one of n3,…,nm contains 10n1−2, say n3, since S(10n1−2)=S(n1)−2, n3 is obtained by adding 1, 2 or 11 after 10n1−2. Adding 1 or 2 yields n2,n1, and we must have n3=100⋅10n1−2+11=10n1−9. Now S(n3)=S(n1) and n3>n1, a contradiction to the choice of n1. So 10n1−2, n3,…,nm satisfy the conditions in the problem, and therefore the sum of their digits is at least f(m−1). Thus,
f(m)−S(n1)−(S(n1)−1)+(S(n1)−2)≥f(m−1),
i.e.
f(m)≥f(m−1)+S(n1)+1.
Let u be such that Fu−1<m≤Fu. By the lemma, there are at most Fu−1 of S(n1),S(n2),…,S(nm) less than or equal to u−1, so S(n1)≥u, and
f(m)≥f(m−1)+u+1.1◯
It is easy to see that f(1)=1, f(2)=3, and hence
f(26)=f(2)+i=3∑26(f(i)−f(i−1))=f(2)+(f(3)−f(2))+(f(5)−f(3))+(f(8)−f(5))+(f(13)−f(8))+(f(21)−f(13))+(f(26)−f(21))≥3+4×1+5×2+6×3+7×5+8×8+9×5 (by equation 1◯)=179,
i.e. ∑i=126S(ni)≥179.
On the other hand, by the property of Fibonacci numbers, there are exactly 8 numbers consisting of digits 1 and 2, with digital sum 5, denoted by a1,a2,...,a8, and there are exactly 13 such numbers with digital sum 6, denoted by b1,b2,...,b13. Add a digit 2 after each of a1,a2,...,a8, denoting these new numbers by c1,c2,...,c8. Add a digit 1 (resp. digit 2) to each of b1,b2,b3,b4,b5, denoting these new numbers by d1,d2,d3,d4,d5 (resp. e1,e2,e3,e4,e5). Now consider
c1,c2,...,c8,d1,d2,...,d5,e1,e2,...,e5,b6,b7,...,b13.
These are pairwise distinct numbers consisting of digits 1 and 2, with total digital sum 7×8+7×5+8×5+6×8=179. And there is none containing another. In fact, if x contains y, since their digital sum is either 6, 7 or 8, and a number with digital sum 8 ends up with 2, it follows that x has exactly one more digit than y. However, deleting the last digit of d1,d2,...,d5 and e1,e2,...,e5 yields b1,b2,...,b5, and deleting the last digit of c1,c2,...,c8 yields a1,a2,...,a8, none of which is in this set of 26 numbers.
We conclude that the least possible value of ∑i=126S(ni) is 179.