Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,13 @@
fn main() {
for num in fibonacci_sequence() {
println!("{}", num);
}
}
fn fibonacci_sequence() -> impl Iterator<Item = u64> {
let sqrt_5 = 5.0f64.sqrt();
let p = (1.0 + sqrt_5) / 2.0;
let q = 1.0 / p;
// The range is sufficient up to 70th Fibonacci number
(0..1).chain((1..70).map(move |n| ((p.powi(n) + q.powi(n)) / sqrt_5 + 0.5) as u64))
}