Computers and Technology

The collatz conjecture, also known as the 3n+1 conjecture (and other names), deals with the following operation to produce a sequence of numbers. given a number, n, if n is even then the next number is n divided by 2. if n is odd, then the next number is 3n+1. the collatz conjecture is that this sequence of numbers always eventually reaches 1. as simple as this seems, it is unproven (and considered extremely hard to prove) by mathematicians. as an example of a sequence, if you start with the number 6, then the terms of the sequence will be: 6, 3, 10, 5, 16, 8, 4, 2, 1. write a program that takes in a positive integer from a user, and computes the collatz sequence, printing out all the numbers in the sequence, followed by a line stating how many iterations it took to reach the value 1.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:20, milkshakegrande101
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy. a. a fire occurs on the premises, and the building isbadly damaged. b. a burglar steals some money and securities from anunlocked safe. c. a business computer is damaged by vandals whobreak into the shop after business hours. d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm. til
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, eddsworldfrantic
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
image
Computers and Technology, 24.06.2019 01:00, kkruvc
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
image
Computers and Technology, 24.06.2019 15:30, lizziesuks
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
Do you know the correct answer?
The collatz conjecture, also known as the 3n+1 conjecture (and other names), deals with the followin...

Questions in other subjects:

Konu
Arts, 28.05.2021 09:10
Konu
Computers and Technology, 28.05.2021 09:10
Konu
English, 28.05.2021 09:10
Konu
Mathematics, 28.05.2021 09:10
Konu
Mathematics, 28.05.2021 09:10