Initial commit

This commit is contained in:
2024-07-07 17:39:59 -07:00
commit 612f25b5ca
4 changed files with 44 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#include <iostream>
#include <string>
// TODO:
// Use GMP for numbers (to allow for really big numbers)
// Make disproving mode
// Make no print mode (for speed, implement after disproving mode)
int main(int argc, char* argv[]) {
// If number not provided
if (argc < 2) {
std::cout << "Usage: " << argv[0] << " <number>\n";
exit(1);
}
long long x { std::stoll(argv[1]) };
std::cout << x << '\n';
while (x != 1) {
if (x % 2 == 0)
x /= 2;
else if (x % 2)
x = x*3+1;
std::cout << x << '\n';
}
}