(I) What is hail guess?
Hail guess means: a positive integer x, if it is an odd number multiplied by 1 plus 3, it is even if the even deposition factor 2ⁿ, so that after a number of times, and ultimately back to 1.
Regardless of how the value of this process huge, like a waterfall as quickly fall. Other figures if not so, after several transformation also bound to the even pure: the cycle 16-8-4-2-1.
According to research studies mathematician Japan and the United States, in all the positive integers less than 7 * 10 ^ 11, are in line with the law.
(Ii) write code in JavaScript
<! DOCTYPE HTML >
< HTML lang = "EN" >
< head >
< Meta charset = "UTF-. 8" >
< title > hail guess or angle ancient Theorem </ title >
</ head >
< body >
< Script >
var X = the parseInt (prompt ( " enter a positive integer " ));
the while (X != 1){
if(x%2 == 0){
X = X / 2; // if it is even precipitated the even factor 2ⁿ
}
the else {
X = X * 3 + . 1 ; // if it is multiplied by an odd number plus 3. 1
}
document.write (X + " <br> " );
}
</ Script >
</ body >
</ HTML >
Example: Input Input 90☟ 9☟
(Iii) The powerful 27
⑴ 27 calculates according to the method described above, it is vigorously float sink exception: First, the step 27 to the converted 77 reaches its peak value 9232, and then through trough 34 reaches a step.
⑵ whole transformation process (referred to as "hail process") needs to step 111, which is the peak value of 9232 reached 342 times the original number of 27;
If ⑶ straight drop waterfall (N th power of 2) to compare the process with the same number N hail 111 to achieve a power of two.
⑷但是在1到100的范围内,像27这样的剧烈波动是没有的(54等27的2的次方倍数的数除外。)
如图所示:27的归一步数要经过多次剧烈波动的奇偶变换,其路径呈不光滑锯齿