Course Solutions Uncategorized (Answered) : Problem 4 Factoring 4a Trialdivision Function Returns Smallest Prime Factor Input Integer Q28563103

(Answered) : Problem 4 Factoring 4a Trialdivision Function Returns Smallest Prime Factor Input Integer Q28563103

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 

<div class=

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post