Solution to Project Euler Problem 53: Combinatoric selections - There are exactly ten ways of selecting three from five, 12345:
123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
In combinatorics, we use the notation, (5 C 3) = 10.
In general. (n C r) = n!/r!(n-r)!, where r ≤ n, n! = n x (n - 1) x ... 3 x 2 x 1, and 0! = 1.


Updated: Oct. 19, 2021 — Training Time: 2 minutes
Overseen by: Archangel Macsika
All Training Resources

Scroll for more menu list

Topic: Project Euler Problem 53: Combinatoric selections.

Difficulty: Easy.

Objective: There are exactly ten ways of selecting three from five, 12345:
123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
In combinatorics, we use the notation, (5 C 3) = 10.
In general, (n C r) = n!/r!(n-r)!, where r ≤ n, n! = n x (n - 1) x ... 3 x 2 x 1, and 0! = 1.
It is not until n = 23, that a value exceeds one-million: (23 C 10) = 1144066.
How many, not necessarily distinct, values of (n C r) for 1 ≤ n ≤ 100, are greater than one-million?

Input: None.

Expected Output: 4075.

Sikademy Solution in Java Programming Language

Sikademy Solution in Python Programming Language

Was this training resource helpful?