Create the function S(n), defined by the following summation:
The symbol
is the combination function ('nchoosek(a,b)' in MATLAB). 'S(n)' always yields an integer value, if 'n' is a positive integer. Present the output modulo 1234567.
NOTE: S(n) may have positive or negative values. Therefore, please use the 'mod' function instead of the 'rem' function to ensure the result would be a positive modulus.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers9
Suggested Problems
-
All your base are belong to us
575 Solvers
-
Sort numbers by outside digits
159 Solvers
-
Lychrel Number Test (Inspired by Project Euler Problem 55)
110 Solvers
-
5796 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2136 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Almost got it, but not quite!
Hi William, you are right. The sign should only be negative when n = 2. Thanks.
Tip: This problem is not solved using combinations or factorials.
S(20) = 177547, you're welcome.