Determines if the value is prime

Assignment Help Basic Computer Science
Reference no: EM131305109

The Syracuse (also called Collatz or Hailstone) sequence is generated by starting with a natural number and repeatedly applying the following function until reaching 1:

937_4e57088c-8470-4881-bb2c-cf5c3072e762.png

For example, the Syracuse sequence starting with 5 is: 5, 16, 8, 4, 2, 1. It is an open question in mathematics whether this sequence will always go to 1 for every possible starting value. Write a program that gets a starting value from the user and then prints the Syracuse sequence for that starting value.

Reference no: EM131305109

Questions Cloud

End inventory level and inventory turnover ratio : Charlie's Cycles Inc. Has $110 million in sales. The company expects that its sales will increase 5% this year. Charlie's CFO uses a simple linear regression to forecast the company's inventory level for a given level of projected sales. Given the es..
Price of call option on the stock that has a strike price : Binomial Model The current price of a stock is $15. In 6 months, the price will be either $20 or $13. The annual risk-free rate is 4%. Find the price of a call option on the stock that has a strike price of $14 and that expires in 6 months.
Write a program that simulates multiple games of blackjack : Blackjack (twenty-one) is a casino game played with cards. The goal of the game is to draw cards that total as close to 21 points as possible without going over. All face cards count as 10 points, aces count as 1 or 11, and all other cards count t..
Call option on the stock that has a strike price : The current price of a stock is $22. In 1 year, the price will be either $28 or $15. The annual risk-free rate is 6%. Find the price of a call option on the stock that has a strike price is of $25 and that expires in 1 year.
Determines if the value is prime : Write a program that gets a starting value from the user and then prints the Syracuse sequence for that starting value.
Black-scholes option pricing model-what is options value : Black-Scholes Model Assume that you have been given the following information on Purcell Industries: Current stock price = $15 Strike price of option = $14 Time to maturity of option = 6 months Risk-free rate = 8% Variance of stock return = 0.11 d1 =..
Define a class to represent logical matrix : COMP3200: Object-Oriented Programming Assignment. Define a class (called LogMat) to represent logical matrix of any binary relation as explained previously. The class has three member variables: matrix (as dynamic 2-D array), rowSize and columnSize
Find the price of a call option on the stock : The current price of a stock is $15. In 6 months, the price will be either $18 or $11. The annual risk-free rate is 7%. Find the price of a call option on the stock that has a strike price of $12 and that expires in 6 months.
What is the exercise value of call option-option time value : A call option on the stock of Bedrock Boulders has a market price of $7. The stock sells for $29 a share, and the option has a strike price of $26 a share. What is the exercise value of the call option? What is the option's time value?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write insertion and removal operations for this tree

In a doubly linked chain, each node can point to the previous node as well as to the next node. Figure 4-9 shows a doubly linked chain and its head pointer. Define a class to represent a node in a doubly linked chain.

  Find a white paper or case study on jad sessions

Research the Web and find a white paper or case study on JAD Sessions. Describe the experience of the author, good or bad, in the discussion. Provide recommendations of what you would do the same, or differently, or any best practices. Be sure..

  What are real world problems

Roach (2007) asserts that IT departments must work more closely with workers on the factory floor, breaking down barriers that have traditionally divided the two groups. The author suggests ways to do this. Discuss a potential challenge that this ..

  Write an application where the user to specifies

Write an application where the user to specifies the polygonal Base of a prism using the mouse. it then creates the vertex, normal, and face lists for the prism, and displays it.

  What is probability that n items hash to different locations

What is the probability that all n items hash to different locations?

  Type of system being developed

Giving reasons for your answer based on the type of system being developed, suggest the most appropriate generic software process model that might be used as a basis for managing the development of the following systems:

  Identifying the risks associated with the current position

Be sure to add a conclusion with a rationale detailing how risks can be mitigated. Reference your research so that Sean may add or refine this report before submission to senior management.

  What are the strengths and weeknesses

What are the strengths? What are the weaknesses? What recommendations would you make for improving host security? Write a one-page paper on your analysis.

  Corporations and high-net-worth individuals

Argue a true statement that: Globalization only significantly affects the CEO's of multinational corporations and high-net-worth individuals.

  Remote access for small offices and teleworkers

Case Study 2: Cisco's Remote Access Go to Cisco's Website and read, "How Cisco IT Provides Remote Access for Small Offices and Teleworkers", located at http://bit.ly/MkvlbA. According to the study, an IDC forecast from December 2007, expected the glo..

  Bank account program in java

Enter the code for the two classes "BankAccount.java" and "Program2.java" shown below. The Program2 class is the driver class that uses the BankAccount worker class to implement the application.

  Determine independent variable and dependent variable

The length of the string is shortened by 5cm and the time is measured. Determine the independent variable? Determine the dependent variable? What must the controlled variables be?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd