Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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. 7391739173919996Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started