Skip to content

Instantly share code, notes, and snippets.

@Jackzmc
Created July 30, 2021 21:27
Show Gist options
  • Select an option

  • Save Jackzmc/7aa2cedc75c20a77eefa70ef87ae8dfa to your computer and use it in GitHub Desktop.

Select an option

Save Jackzmc/7aa2cedc75c20a77eefa70ef87ae8dfa to your computer and use it in GitHub Desktop.
fn main() {
let mut i: u64 = 0;
let mut v: u64;
let mut highest = u64::MIN;
loop {
i += 1;
v = i;
loop {
// Is even
if v % 2 == 0 {
v /= 2;
} else {
v = 3 * v + 1;
}
if v > highest {
highest = v;
}
if v == 1 {
if i % 1_000_000 == 0 {
println!("{:10}: All Pass | HI {:10}", i, highest);
}
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment