Big Numbers

Find the last 9 digits in the number i = 1 100 i ! . \sum\limits_{i=1}^{100} i!.

Clarification : ! ! denotes the factorial notation.


The answer is 420940313.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Spencer Whitehead
Jan 31, 2016

Since we only need the last 9 digits, we can do all our math modulo 1 0 9 10^9 to avoid exceeding the 64-bit signed integer type. Alternatively, we can use a language with big numbers. A simple implementation in Ruby is shown below.

1
2
3
4
5
sum = 0
(1..100).each do |i|
    sum += (1..i).inject(:*)          #simple way of calculating factorials
end
puts sum % (10 ** 9)

汶良 林
Feb 1, 2016

I use Excel!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...