subject

Suppose that the first number of a sequence is x, where x is an integer. define: a0 = x; an+1 = an / 2 if an is even; an+1 = 3 x an + 1 if an is odd. then there exists an integer k such that ak = 1. instructions write a program that prompts the user to input the value of x. the program outputs: the numbers a0, a1, a2, . . , ak. the integer k such that ak = 1 (for example, if x = 75, then k = 14, and the numbers a0, a1, a2, a14, respectively, are 75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1.) test your program for the following values of x: 75, 111, 678, 732, 873, 2048, and 65535.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 12:00
Jack is assisting his younger sibling mary with her mathematics assignment, which includes a study of the number system. jack explains to mary that whole numbers are counting numbers that could be used to record the number of fruits in a basket. which data type represents whole numbers? a.integers.b.floating-point numbers. c.strings.d.boolean
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
One important thing in finding employment is to get your resume noticed and read.true or false
Answers: 2
question
Computers and Technology, 25.06.2019 06:00
Write a method public static string getdigits(string phonenumber) that takes an 11-character phone number written with any combination of 11 uppercase letters, lowercase letters and/or digits, and zero or more hyphens, and which returns the digits that a person would have to press on a cell phone to dial that phone number. we will use the mapping of letters to digits given at en.wikipedia.org/wiki/telephone_keypad# /media/file: telephone-keypad2.svg you may assume that the string parameter phonenumber contains some combination of exactly 11 uppercase letters, lowercase letters and/or digits, but that any number of hyphens may be present. you can assume that a hyphen will not appear as the first or last character of the string. do not assum
Answers: 3
question
Computers and Technology, 25.06.2019 09:00
What are some of the things many ctsos do for their members ?
Answers: 1
You know the right answer?
Suppose that the first number of a sequence is x, where x is an integer. define: a0 = x; an+1 = an...
Questions
question
Mathematics, 22.04.2020 02:21
Questions on the website: 13722361