Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

=+What kinds of problems need to be overcome?

Answered: 1 week ago