Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Standard ML code (SML) 1.Write a function Factors that for a given natural number N , and numbers low and high , returns a

Use Standard ML code (SML)

1.Write a function Factors that for a given natural number N , and numbers low and high , returns a list of the numbers between

low and high (both included) that divide N.

2. Write a function CoPrimethat for two given natural numbers p and q returns true if p and q are co-prime (have no factors in common except 1).

Example inputs and outputs:

Factors (24 ,3 ,9);

v a l i t = [ 3 , 4 , 6 , 8 ] : i n t l i s t

CoPrime (24 ,25);

v a l i t = true : bool

CoPrime (22 ,33);

v a l i t = f a l s e : bool

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

Students also viewed these Databases questions