Create iterators with an initial value and a recurrence relation.
use unfold_iter::unfold; for x in unfold(2, |&x| x * 2).take(5) { println!("{}", x); } // 2, 4, 8, 16, 32