subject

Write a function that receives an integer (n) argument and then computes the following based on the value of the integer: while the value of n is greater than 1, replace the integer with half of its value (n/2) if the integer is even. otherwise, replace the integer with three times its value, plus 1 (3*n + 1). make provision to count the number of values in (or the length of) the sequence that results. test your function: if n = 10, the sequence of integers is 5, 16, 8, 4, 2, 1 and so the length is 6. make a plot of the length of the sequence that occurs as a function of the integers from 2 to 30. for example, when n = 10, the length is 6 while for n = 15, the length is 17.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 19:30
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a,b] se pot scrie ca produs de două numere prime? “.
Answers: 3
question
Computers and Technology, 24.06.2019 18:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best-suited for this?
Answers: 1
You know the right answer?
Write a function that receives an integer (n) argument and then computes the following based on the...
Questions
question
Mathematics, 14.12.2020 21:50
Questions on the website: 13722360