Crates.io | collatz |
lib.rs | collatz |
version | 0.5.1 |
source | src |
created_at | 2021-09-04 12:30:42.118006 |
updated_at | 2023-07-06 17:36:20.770775 |
description | Helper functions related to the Collatz conjecture |
homepage | https://github.com/niederb/collatz |
repository | https://github.com/niederb/collatz |
max_upload_size | |
id | 446809 |
size | 32,774 |
Helper functions related to the Collatz conjecture (also know as the 3n + 1 problem or the 3n + 1 conjecture).
Given a positive integer N do the following steps repeatedly:
Please enter a positive integer
19
Collatz steps for number 19
Collatz steps [19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]
⡁ ⢰⡇ 88.0
⠄ ⡎⢸
⠂ ⢠⠃ ⡇
⡁ ⡜ ⠸⡀
⠄ ⢀⠇ ⢇
⠂ ⣴ ⡸ ⠸⡀
⡁ ⢰⠁⢣ ⡇ ⢇ ⡴⡀
⠄ ⢀⠇ ⠈⢆ ⢸ ⠘⡄ ⢰⠁⠱⡀
⠂ ⡜ ⠘⡄ ⡇ ⠘⡄ ⢀⠇ ⠱⡀ ⡴⡀
⡁⢰⠁ ⠸⣰⠁ ⠘⢄ ⡠⢆ ⡜ ⠱⡀ ⡜ ⠱⡀
⢄⠇ ⠙ ⠈⢆ ⡰⠁ ⠱⡀ ⢰⠁ ⠱⡀ ⡜ ⠘⡄
⡞ ⠈⠢⢄ ⡔⠁ ⠈⢆⢀⠇ ⠑⢄ ⡜ ⠘⢄⡀
⡁ ⠑⢄ ⡜ ⠙ ⠑⢄⡜ ⠈⠢⢄ ⡠⢄⡀
⠄ ⠙ ⠁ ⠑⠤⢄⣀ ⡠⠊ ⠈⠑⠢⣀⡀
⠂ ⠉⠑⠊ ⠈⠉⠒⠤⠤⠤⠤⢄⣀⣀⣀⡀
⠁ ⠈ 1.0
0.0 21.0