OFFSET
0,3
COMMENTS
If n > 5, then 9 divides a(n). - Enrique Pérez Herrero, Mar 01 2009
LINKS
Maciej Ireneusz Wilczynski, Table of n, a(n) for n = 0..10000
Florian Luca, The number of non-zero digits of n!, Canad. Math. Bull. 45 (2002), pp. 115-118.
Carlo Sanna, On the sum of digits of the factorial, arXiv:1409.4912 [math.NT], 2014.
Carlo Sanna, On the sum of digits of the factorial, Journal of Number Theory 147 (February 2015), pp. 836-841.
FORMULA
Luca shows that a(n) >> log n. In particular, a(n) > log_10 n - log_10 log_10 n. - Charles R Greathouse IV, Dec 27 2011
Approximately log_10(n!)*9/2. The approximation usually exceeds a(n). - Carmine Suriano, Feb 20 2013 [Corrected by Martin Fuller, Feb 02 2026]
Sanna improved Luca's result to a(n) >> log n log log log n. - Charles R Greathouse IV, Jan 30 2015
a(n) = 9*A202708(n), n>=6. - R. J. Mathar, Jul 30 2021
Conjecture (heuristic, from Stirling's formula and A027868): a(n) = c1 * n * log n - (c1 + 9/8) * n + O(log n), with c1 = 9 / (2*log(10)). - Mike Sheppard, Sep 21 2025
a(10^k) = a(10^k - 1) for any k >= 0. - Michael Shmoish, Mar 23 2026
EXAMPLE
a(5) = 3 because 5! = 120 and 1 + 2 + 0 = 3.
a(6) = 9 because 6! = 720 and 7 + 2 + 0 = 9.
MAPLE
seq(convert(convert(n!, base, 10), `+`), n=0..100); # Robert Israel, Nov 13 2014
MATHEMATICA
Table[ Plus @@ IntegerDigits[n!], {n, 0, 100}] (* Enrique Pérez Herrero, Mar 01 2009 *)
PROG
(PARI) a(n)=my(v=eval(Vec(Str(n!)))); sum(i=1, #v, v[i]) \\ Charles R Greathouse IV, Dec 27 2011
(PARI) a(n) = sumdigits(n!); \\ Michel Marcus, Sep 18 2014
(Magma) [&+Intseq(Factorial(n)): n in [0..70]]; // Vincenzo Librandi, Jan 30 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved
