User talk:Fullstop/Sandbox/T2
Appearance
#include <stdio.h> int main(void) /* empirically test Collatz' 3n+1 conjecture */ { unsigned long min, max; while (fscanf(stdin, "%lu %lu\n", &min, &max) == 2) { unsigned long mm = min, max_cycle_len = 0; while (mm <= max) { unsigned long cycle_len = 0; unsigned long n = mm++; for (;;) { cycle_len++; if (n == 1) break; if (n & 1) n += (n << 1) | 1; else n >>= 1; } if (cycle_len > max_cycle_len) max_cycle_len = cycle_len; } printf("%lu %lu %lu\n", min, max, max_cycle_len); } return 0; }
Start a discussion about improving the User:Fullstop/Sandbox/T2 page
Talk pages are where people discuss how to make content on Wikipedia the best that it can be. You can use this page to start a discussion with others about how to improve the "User:Fullstop/Sandbox/T2" page.