login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Sum of digits of n!.
24

%I #86 Aug 26 2024 11:42:56

%S 1,1,2,6,6,3,9,9,9,27,27,36,27,27,45,45,63,63,54,45,54,63,72,99,81,72,

%T 81,108,90,126,117,135,108,144,144,144,171,153,108,189,189,144,189,

%U 180,216,207,216,225,234,225,216,198,279,279,261,279,333,270,288

%N Sum of digits of n!.

%C If n > 5, then 9 divides a(n). - _Enrique Pérez Herrero_, Mar 01 2009

%H Maciej Ireneusz Wilczynski, <a href="/A004152/b004152.txt">Table of n, a(n) for n = 0..10000</a>

%H Florian Luca, <a href="http://math.ca/10.4153/CMB-2002-013-9">The number of non-zero digits of n!</a>, Canad. Math. Bull. 45 (2002), pp. 115-118.

%H Carlo Sanna, <a href="http://arxiv.org/abs/1409.4912">On the sum of digits of the factorial</a>, Journal of Number Theory 147 (February 2015), pp. 836-841. arXiv:1409.4912 [math.NT].

%H Carlo Sanna, <a href="https://dx.doi.org/10.1016/j.jnt.2014.09.003">On the sum of digits of the factorial</a>, Journal of Number Theory 147 (February 2015), pp. 836-841.

%F 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

%F a(n) < floor(log_10(n)*9/2). - _Carmine Suriano_, Feb 20 2013

%F a(n) = A007953(A000142(n)). - _Michel Marcus_, Sep 18 2014

%F a(n) < 9*(A034886(n) - A027868(n)). - _Enrique Pérez Herrero_, Nov 16 2014

%F Sanna improved Luca's result to a(n) >> log n log log log n. - _Charles R Greathouse IV_, Jan 30 2015

%F a(n) = 9*A202708(n), n>=6. - _R. J. Mathar_, Jul 30 2021

%e a(5) = 3 because 5! = 120 and 1 + 2 + 0 = 3.

%e a(6) = 9 because 6! = 720 and 7 + 2 + 0 = 9.

%p seq(convert(convert(n!,base,10),`+`),n=0..100); # _Robert Israel_, Nov 13 2014

%t Table[ Plus @@ IntegerDigits[n!], {n, 0, 100}] (* _Enrique Pérez Herrero_, Mar 01 2009 *)

%o (PARI) a(n)=my(v=eval(Vec(Str(n!))));sum(i=1,#v,v[i]) \\ _Charles R Greathouse IV_, Dec 27 2011

%o (PARI) a(n) = sumdigits(n!); \\ _Michel Marcus_, Sep 18 2014

%o (Magma) [&+Intseq(Factorial(n)): n in [0..70]]; // _Vincenzo Librandi_, Jan 30 2015

%Y Cf. A000142 (factorial), A007953 (sum of digits), A079584 (same in base 2), A086358 (digital root of n!).

%Y Cf. A066419 (k such that a(k) does not divide k!).

%K nonn,base

%O 0,3

%A _N. J. A. Sloane_