Problem 52729. Easy Sequences 21: Combinatorial Summations
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
Show
1 older comment
Ramon Villamangca
on 19 Sep 2021
Hi William, you are right. The sign should only be negative when n = 2. Thanks.
Rafael S.T. Vieira
on 24 Nov 2022
Tip: This problem is not solved using combinations or factorials.
Rafael S.T. Vieira
on 24 Nov 2022
S(20) = 177547, you're welcome.
Solution Comments
Show commentsGroup

Easy Sequences Volume II
- 10 Problems
- 5 Finishers
- Easy Sequences 13: Average Speed of Spaceship
- Easy Sequences 16: Volume of Embedded Octahedron
- Easy Sequences 18: Set Bits of Triple Summations
- Easy Sequences 21: Combinatorial Summations
- Easy Sequences 23: Hat Guessing Game!
- Easy Sequences 24: Number of Coprime Lattice Points
- Easy Sequences 25: Product of Series
- Easy Sequences 31: N-N's Sequence
- Easy Sequences 27: Product of Radicals of Integers
- Easy Sequences 28: Sum of Radicals of Integers
Problem Recent Solvers7
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!