Question: in python Write a function divisorsOfN that takes an int n2 and Sample Input: n2 = 30 Sample Output l = [1, 2, 3, 5,

in python

Write a function divisorsOfN that takes an int n2 and Sample Input: n2 = 30 Sample Output l = [1, 2, 3, 5, 6, 10, 15, 30] returns a list of all divisors of n2.

Write a function hailstone that takes an int n3 and prints the hailstone sequence. Hailstone Numbers: This sequence takes the name hailstone as the numbers generated bounce up and down. To generate the sequence, follow these rules: a. If the number is odd multiply it by 3 and add 1 b. If the number is even, divide by two. c. Repeat until you reach number 1. Sample Inputs & Outputs n3 = 3 -> 10, 5, 16, 8, 4, 2, 1 n3 = 6 -> 3, 10, 5, 16, 8, 4, 2, 1 n3 = 7-> 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1

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!