Question: python 3.6 beginner 280 Chapter 8. Loop Structures and Booleans 4. The Syracuse (also called Collatz or Hailstone) sequence is gen by starting with a

 python 3.6 beginner 280 Chapter 8. Loop Structures and Booleans 4.

python 3.6 beginner

280 Chapter 8. Loop Structures and Booleans 4. The Syracuse (also called "Collatz" or "Hailstone") sequence is gen by starting with a natural number and repeatedly applying the follones function until reaching 1: generale r/2 if x is even 3r +1 if x is odd syr(z)- For example, the Syracuse sequence starting with 5 is: 5, 16.8.42 an open question in mathematics whether this sequence will always 80 8 1 for every possible starting value. 1. tis Write a program that gets a starting value from the user and then primn the Syracuse sequence for that starting value. 5. A positive whole number n > 2 is prime if no number between 2 and i (inclusive) evenly divides n. Write a program that accepts a value of u input and determines if the value is prime. If n is not prime, your progra should quit as soon as it finds a value that evenly divides n 6. Modify the previous program to find every prime number lss than or eai to n. 7. The Goldbach conjecture asserts that every even number is the sum of ve prime numbers. Write a program that gets a number from the user, checa to make sure that it is even, and then finds two prime numbers that a up to the number. 8. The greatest common divisor (GCD) of two values can be computed usng Euclid's algorithm. Starting with the values m and n, we repeatedly av the formula: n, m = m, nem until m is 0. At that point, n is the the original m and n. Write a program that finds the GCD of two nume using this algorithm. 9. Write a program that computes the fuel eficiency of a mulih ng t ae The program will first prompt for the starting odometer reading get information about a series of legs. For each leg, t current odometer reading and the amount of gas used (se t space). The user signals the end of the trip with a blank line. should print out the miles per gallon achieved on each leg a each leg, the user enters t MPG for the trip. 0h preiousfroma e

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!