Colorful consecutive (Part 10)

S = 1 2 3 ! + 2 3 4 ! + 3 4 5 ! + + 7 8 9 ! + 8 9 0 ! \Large{S=\color{#20A900}1\color{#D61F06}2\color{#3D99F6}3!+\color{#D61F06}2\color{#3D99F6}3\color{#EC7300}4!+\color{#3D99F6}3\color{#EC7300}4\color{magenta}5!+\ldots+\color{#D61F06}7\color{#3D99F6}8\color{#EC7300}9!+\color{#3D99F6}8\color{#EC7300}9\color{magenta}0!}

Find S S mod \text{mod} 1 2 3 4 5 6 7 8 9 0 \color{#20A900}1\color{#D61F06}2\color{#3D99F6}3\color{#EC7300}4\color{magenta}5\color{#20A900}6\color{#D61F06}7\color{#3D99F6}8\color{#EC7300}9\color{magenta}0


The answer is 107086230.

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

Isaac Buckley
Aug 27, 2015

compski compski

Wolfram saved the day for this one.

Wow! I thought Wolfram Alpha can't evaluate this!

Adam Phúc Nguyễn - 5 years, 9 months ago

Log in to reply

Me too, I prayed and wolfram answered!

No "Wolfram|Alpha needs more time to respond to your query..."

Or "Computation timed out. Experimental feature: Try again with more time »"

Or "Computation timed out. No more results available."

The trick is to never loose faith in wolfram and he'll bless you.

Isaac Buckley - 5 years, 9 months ago

Log in to reply

Well, may be you can use an elementary way, but it's verrrryyyy long, and I'm lazy.

Adam Phúc Nguyễn - 5 years, 9 months ago

You don't know the power of Wolfram Alpha :P

Arulx Z - 5 years, 9 months ago
Arulx Z
Aug 27, 2015

At current stage, it's very easy and quick to compute the answer directly.

Here's the manual code:

1
2
>>> import math
>>> (math.factorial(123) + math.factorial(234) + math.factorial(345) + math.factorial(456) + math.factorial(567) + math.factorial(678) + math.factorial(789) + math.factorial(890)) % 1234567890

Moderator note:

Simple standard approach.

Here 's a C++ solution. Adding it here for the sake of variety. I envy you since I can't do it directly like that in C++ because of data type range limitations. :|

Prasun Biswas - 5 years, 9 months ago

Log in to reply

That's true. I remember banging my head against the walls and using Big Integer (in Java) while others were comfortably using python.

Arulx Z - 5 years, 9 months ago

Log in to reply

Haha, I can relate to that. :D

Prasun Biswas - 5 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...