Rust Implementation of Problem 15
View source code here on GitHub!
Includes
Problem Solution
- pub fn problems::p0015::p0015() -> utils::Answer
1/*
2Project Euler Problem 15
3
4This one was also relatively easy, especially given the work I have
5done on my prime number infrastructure.
6
7Problem:
8
9The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
10
11Find the sum of all the primes below two million.
12*/
13use crate::include::math;
14use crate::include::utils::Answer;
15
16pub fn p0015() -> Answer {
17 return Answer::Int(math::n_choose_r::<u64>(40, 20).into());
18}