OFFSET
2,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..1000
Robin Fissum, Digit sums and the number of prime factors of the factorial n!=1.2...n, Bachelor's project in BMAT, Norwegian University of Science and Technology, 2020.
Jan-Christoph Puchta and Jürgen Spilker, Altes und Neues zur Quersumme, Math. Semesterber., Vol. 49, No. 2 (2002), pp. 209-226; alternative link.
Vladimir Shevelev, Compact integers and factorials, Acta Arith., Vol. 126, No. 3 (2007), pp. 195-236 (see p. 205).
FORMULA
From Vladimir Shevelev, Jun 03 2011: (Start)
a(n) = (n-1)*n - Sum_{i=2..n} (i-1)*Sum_{r>=1} floor(n/i^r).
a(n) <= (n-1)^2*log(n+1)/log(n).
Problem: find a better upper estimate. (End)
From Amiram Eldar, Apr 16 2021: (Start)
a(n) = A014837(n) + 1.
a(n) ~ (1-Pi^2/12)*n^2 + O(n^(3/2)) (Fissum, 2020). (End)
EXAMPLE
5 = 101_2 = 12_3 = 11_4 = 10_5. Thus a(5) = 2 + 3 + 2 + 1 = 8.
MATHEMATICA
Table[Sum[Total[First[RealDigits[n, i]]], {i, 2, n}], {n, 2, 80}] (* Carl Najafi, Aug 16 2011 *)
PROG
(PARI) a(n) = sum(i=2, n, vecsum(digits(n, i))); \\ Michel Marcus, Jan 03 2017
(PARI) a(n) = sum(b=2, n, sumdigits(n, b)); \\ Michel Marcus, Aug 18 2017
(Python)
from sympy.ntheory.digits import digits
def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n+1))
print([a(n) for n in range(2, 62)]) # Michael S. Branicky, Apr 04 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved