This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A072817 #12 Jan 28 2020 16:13:18 %S A072817 1,286,4621,56980,640663,6904678,72722233,755339992,7774461355, %T A072817 79520082490,809705785165,8217213032524,83178920046367, %U A072817 840306174900622,8475694265094817,85380606857454976,859192675118710099,8638686211723117474,86794540082486097589,871513270875022245748 %N A072817 Accumulative sum of the greatest digit of n minus the least digit of n (A037904) <= 10^n. %C A072817 Let b(n) = sum( A037904(k),{k=1..n}), then the lim b(n)/n -> 9. Reason, as the number of digits increases, then the likelihood of the maximum digit -> 9 and the minimum digits -> 0 becomes one. %H A072817 Andrew Howroyd, <a href="/A072817/b072817.txt">Table of n, a(n) for n = 1..200</a> %F A072817 a(n) = 1 + Sum_{w=1..n} Sum_{k=1..9} (10-k)*k*((k+1)^w - 2*k^w + (k-1)^w) - k*((k+1)^(w-1) - k^(w-1)). - _Andrew Howroyd_, Jan 28 2020 %t A072817 f[n_] := Block[{d = IntegerDigits[n]}, Max[d] - Min[d]]; s = 0; k = 0; Do[ While[k != 10^n, k++; s = s + f[k]]; Print[s], {n, 1, 8}] %o A072817 (PARI) a(n)={1 + sum(w=1, n, sum(k=1, 9, (10-k)*k*((k+1)^w - 2*k^w + (k-1)^w) - k*((k+1)^(w-1) - k^(w-1))))} \\ _Andrew Howroyd_, Jan 28 2020 %Y A072817 Cf. A037904. %K A072817 nonn,base %O A072817 1,2 %A A072817 _Benoit Cloitre_ and _Robert G. Wilson v_, Aug 09 2002 %E A072817 a(9)-a(12) from _Donovan Johnson_, Apr 09 2010 %E A072817 Terms a(13) and beyond from _Andrew Howroyd_, Jan 28 2020