1-5-18: Angle Valley conjecture

Source: Internet
Author: User

Describe

The so-called Angular Valley conjecture, refers to any positive integer, if it is odd, then multiply 3 plus 1, if it is even, then divided by 2, the results are repeated in accordance with the above rules, the final total can be obtained 1. For example, assume that the initial integer is 5 and the calculation process is 16, 8, 4, 2, 1, respectively.
The program requires the input of an integer that will be processed to get 1 of the process output.

Enter a positive integer n (n <= 2,000,000) to output the step from the input integer to 1, each step is a row, each part describes the calculation process. The last line outputs "end". If the input is 1, output "End" directly. Sample input

5

Sample output

5*3+1=1616/2=88/2=44/2=22/2=1end

SOURCE 6179

1-5-18: Angle Valley conjecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.