recaman

Crates.iorecaman
lib.rsrecaman
version0.1.0
sourcesrc
created_at2018-06-16 10:33:16.214362
updated_at2018-06-16 10:33:16.214362
descriptionIterator for the Recaman's sequence
homepage
repositoryhttps://github.com/joshleeb/recaman
max_upload_size
id70336
size5,731
Josh Leeb-du Toit (joshleeb)

documentation

https://docs.rs/crate/recaman/

README

Recaman

Latest Version Rust Documentation Build Status

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 42, 17, 43, 16, 44, 15, 45, 14, 46, 79, 113, 78, 114, 77, 39, 78, 38, 79, 37, 80, 36, 81, 35, 82, 34, 83, 33, 84, 32, 85, 31, 86, 30, 87, 29, 88, 28, 89, 27, 90, 26, 91, 157, 224, 156, 225, 155

A005132 Recamán's sequence.

  • A(0) = 0
  • For n > 0
    • A(n) = A(n-1) - n if positive and not already in the sequence
    • A(n) = A(n-1) + 1 otherwise
Commit count: 0

cargo fmt