M
M
mishanya1742015-09-17 10:07:21
Mathematics
mishanya174, 2015-09-17 10:07:21

What is the sum of the digits in the factorial of 337?

Please help me calculate the sum of the digits of the factorial "337!". That is, if 6!=720, then the sum of its digits will be 7+2+0=9. What will be the sum of the digits "337!" ? Obviously, it will not work, the number is very large, there is a hint, a sign of divisibility by 3 or 9.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Daniil Kolesnichenko, 2015-09-17
@mishanya174

factorial = lambda n: (n == 0 and 1) or factorial(n - 1) * n
sum(int(i) for i in str(factorial(337)))    # => 2817

A
AVKor, 2015-09-17
@AVKor

In the development of the method using maxima, proposed by Armenian Radio :

s: 0$ for n: 337! next (n-r)/10 while n >= 1 do (r: mod(n,10), s: s+r)$ s;

A
Armenian Radio, 2015-09-17
@gbg

Take a calculator and fold 130932804149088992546057261943598916651380085320056882046632369209980447 \
366486195583875107499552077757320239493552004852577547570260331861859535521014 \
367028762150336371971084184802220775697724840028097301334011793388942370614718 \
341215113319703287766478296719019864501440605926667194653195515282444560161328 \
301222855804492620971650056743347973226019758046208866500052558105710981673345 \
457144935004205153930768986245233790635907756296677802809190469443074096751804 \
464370890609618413796499897335752206338990966921419488285779097481797799327000 \
523783874784902588031943372895509486862780297994201058534583425203348291866696 \
42514432000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) Students who master maxima
can confuse the teacher. The factorial is calculated in less than a second.

A
Andrew, 2015-09-17
@OLS

www.wolframalpha.com/input/?i=sum+of+digits+of+337!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question