import numpy def collatz(n): list1 = [n] if n == 1: return [1] elif n % 2 == 0: =%3D 0 : list1.extend(collatz(n//2)) else: list1.extend(collatz(n*3+1) return list1 I'm trying to write a program where...

I need the answer as soon as possibleimport numpy<br>def collatz(n):<br>list1 = [n]<br>if n == 1:<br>return [1]<br>elif n % 2 == 0:<br>=%3D<br>0 :<br>list1.extend(collatz(n//2))<br>else:<br>list1.extend(collatz(n*3+1)<br>return list1<br>I'm trying to write a program where I can<br>choose the multiplier, divisors, and number.<br>I was able to figure out how to multiply 3 and<br>divide 2 to the number I want, but now I want to<br>choose my own multiplier and divisors instead<br>of 3 and 2.<br>More Info: this is the collatz sequence.<br>

Extracted text: import numpy def collatz(n): list1 = [n] if n == 1: return [1] elif n % 2 == 0: =%3D 0 : list1.extend(collatz(n//2)) else: list1.extend(collatz(n*3+1) return list1 I'm trying to write a program where I can choose the multiplier, divisors, and number. I was able to figure out how to multiply 3 and divide 2 to the number I want, but now I want to choose my own multiplier and divisors instead of 3 and 2. More Info: this is the collatz sequence.

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here