%I #47 Apr 05 2022 03:20:11
%S 1,3,4,8,10,16,17,21,25,35,34,46,52,60,58,74,73,91,92,104,114,136,128,
%T 144,156,168,171,199,193,223,221,241,257,281,261,297,315,339,333,373,
%U 367,409,416,430,452,498,472,508,515,547,556,608,598,638,634,670,698,756,717,777
%N Sum of all digits in all base-b representations for n, for 2 <= b <= n.
%H Alois P. Heinz, <a href="/A043306/b043306.txt">Table of n, a(n) for n = 2..1000</a>
%H Robin Fissum, <a href="http://dx.doi.org/10.13140/RG.2.2.17412.35201">Digit sums and the number of prime factors of the factorial n!=1.2...n</a>, Bachelor's project in BMAT, Norwegian University of Science and Technology, 2020.
%H Jan-Christoph Puchta and Jürgen Spilker, <a href="https://doi.org/10.1007/s00591-002-0048-4">Altes und Neues zur Quersumme</a>, Math. Semesterber., Vol. 49, No. 2 (2002), pp. 209-226; <a href="http://www.math.uni-rostock.de/~schlage-puchta/papers/Quersumme.pdf">alternative link</a>.
%H Vladimir Shevelev, <a href="http://dx.doi.org/10.4064%2Faa126-3-1">Compact integers and factorials</a>, Acta Arith., Vol. 126, No. 3 (2007), pp. 195-236 (see p. 205).
%F From _Vladimir Shevelev_, Jun 03 2011: (Start)
%F a(n) = (n-1)*n - Sum_{i=2..n} (i-1)*Sum_{r>=1} floor(n/i^r).
%F a(n) <= (n-1)^2*log(n+1)/log(n).
%F Problem: find a better upper estimate. (End)
%F From _Amiram Eldar_, Apr 16 2021: (Start)
%F a(n) = A014837(n) + 1.
%F a(n) ~ (1-Pi^2/12)*n^2 + O(n^(3/2)) (Fissum, 2020). (End)
%e 5 = 101_2 = 12_3 = 11_4 = 10_5. Thus a(5) = 2 + 3 + 2 + 1 = 8.
%t Table[Sum[Total[First[RealDigits[n, i]]], {i, 2, n}], {n, 2, 80}] (* _Carl Najafi_, Aug 16 2011 *)
%o (PARI) a(n) = sum(i=2, n, vecsum(digits(n, i))); \\ _Michel Marcus_, Jan 03 2017
%o (PARI) a(n) = sum(b=2, n, sumdigits(n, b)); \\ _Michel Marcus_, Aug 18 2017
%o (Python)
%o from sympy.ntheory.digits import digits
%o def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n+1))
%o print([a(n) for n in range(2, 62)]) # _Michael S. Branicky_, Apr 04 2022
%Y Cf. A014837, A043000, A068953, A191251, A191322, A191350, A309531.
%Y Row sums of A240236.
%K nonn,base
%O 2,2
%A _Clark Kimberling_