login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004152 Sum of digits of n!. 17
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, 81, 108, 90, 126, 117, 135, 108, 144, 144, 144, 171, 153, 108, 189, 189, 144, 189, 180, 216, 207, 216, 225, 234, 225, 216, 198, 279, 279, 261, 279, 333, 270, 288 (list; graph; refs; listen; history; text; internal format)
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, Journal of Number Theory 147 (February 2015), pp. 836-841. arXiv:1409.4912 [math.NT].

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

a(n) < floor(log_10(n)*9/2). - Carmine Suriano, Feb 20 2013

a(n) = A007953(A000142(n)). - Michel Marcus, Sep 18 2014

a(n) < 9*(A034886(n) - A027868(n)). - Enrique Pérez Herrero, Nov 16 2014

Sanna improved Luca's result to a(n) >> log n log log log n. - Charles R Greathouse IV, Jan 30 2015

EXAMPLE

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

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

MAPLE

P:=proc(n) local i, t1, t2; for i from 0 by 1 to n do t1:=i!; t2:=0; while t1 <> 0 do t2:= t2+(t1 mod 10); t1 := floor(t1/10); od; print(t2); od; end: P(100); # Paolo P. Lava, Jun 30 2006

# Simpler alternative:

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

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

Sequence in context: A105815 A136696 A086358 * A071678 A316164 A319276

Adjacent sequences:  A004149 A004150 A004151 * A004153 A004154 A004155

KEYWORD

nonn,base

AUTHOR

N. J. A. Sloane

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 20 13:59 EDT 2018. Contains 316379 sequences. (Running on oeis4.)