-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rs
27 lines (24 loc) · 856 Bytes
/
main.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::{collections::HashSet, path::PathBuf};
use oeis_utils::NumberValue;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "example", about = "An example of StructOpt usage.")]
struct Opt {
#[structopt(parse(from_os_str))]
input: PathBuf,
}
fn main() {
let opt = Opt::from_args();
let oeis_db = oeis_utils::OEISDatabase::from_path(&opt.input).unwrap();
let ss = oeis_db.series();
let all_nums: HashSet<i128> = ss
.iter()
.flat_map(|s| s.values())
.filter_map(|e| match e {
NumberValue::InRange(i) => Some(*i),
NumberValue::OutOfRange(_) => None, // If we don't fit in a i128 we are not going to be the smallest number
})
.collect();
let res = (0_i128..).find(|e| !all_nums.contains(e)).unwrap();
println!("{} not found!", res);
}