The hail conjecture (also known as the 3n+1 problem, the Angle Ancient Conjecture) is that a positive integer n, divided by 2 if it is even, multiplied by 3 and added by 1 if it is odd, will eventually become 1 after a number of such judgments. This conjecture consisting of two judgment statements seems simple, but its correctness is not certain so far. No inverse sequence can overturn the conjecture, and there is no rigorous demonstration to prove that the formula is definitely correct.
C function code output cycles:
Int Hailstone(int n) {int len=1; while(1<n) { if(n%2==0)n=n/2; else n=3*n+1; len++; } return len; }Copy the code
You can use automatic random number generation to try this guess. QAQ