-->
当前位置:首页 > 题库

PROGRAMMING:Odd even normalization conjecture (multiple sets of data)

Luz5年前 (2021-05-10)题库378
Input two positive integers a and B (1 < a < B < 1000), and output the verification process of parity normalization conjecture of all numbers between them.
[popular science] parity normalization conjecture, also known as 3N + 1 conjecture, hail conjecture, Jiaogu conjecture, etc. Its content is "for any positive integer, if it is odd, multiply it by 3 and then add 1, if it is even, divide it by 2, and then loop in this way, you can finally get 1".
For example, integer 7, its transformation process is: 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1.
###Input example:
```in
10 12
```
###Output example:
```out
10:5 16 8 4 2 1
11:34 17 52 26 13 40 20 10 5 16 8 4 2 1
12:6 3 10 5 16 8 4 2 1
```






answer:If there is no answer, please comment