Question: using Python Problem 4: More factoring 4a. The trial_division function returns the smallest prime factor of the input integer, e.g. trial division 15)-3. Use it

using Python

using Python Problem 4: More factoring 4a. The trial_division function returns thesmallest prime factor of the input integer, e.g. trial division 15)-3. Use

Problem 4: More factoring 4a. The trial_division function returns the smallest prime factor of the input integer, e.g. trial division 15)-3. Use it to find the smallest prime factor of 4a.1.120 4a.2. 21931 4b. Write a function tdfactor(N) that takes as input an integer N and then tries to factor it by doing the following: uses trial_divison(N) to find the smallest prime factor d of N and then replaces N by N/d and starts over -tdfactor(N) must return a non-decreasing list of prime factors of N counting multiplities, e.g. tdfactor(12) returns [2,2,3, tdfactor(100) returns [2,2,5,5, etc Your function has to be reasonably efficient, e.g. it can't take more than one second to solve 4c.3 -Other than trial_division), you are not allowed to use any other built-in Sage functions that are not available in Python 4c. Use your function tdfactor(N) from 4b to factor the same integers as in problem 3d. -4c.1.12 -4c.2. 120 -4c.3. 7391739173919996

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!