Question: Problem 1 Write a function is_factor() according to the following specification: FUNCTION: is_factor() INPUTS: f, n; two length-l numeric vectors OUTPUT: TRUE if f is

Problem 1 Write a function is_factor() according to the following specification: FUNCTION: is_factor() INPUTS: f, n; two length-l numeric vectors OUTPUT: TRUE if f is a factor of n, FALSE otherwise Problem 2 Write a function sum_factors( ) according to the following pseudocode: FUNCTION: sum_factors() INPUT: n; a positive Whole number OUTPUT: the sum of the factors of n PSEUDOCODE: initialize an object to be zero look at the positive integers up to n (inclusive): if any of the integers are factors of n: add their value to the object output the sum of the factors of n Problem 3 Write a function is _perfect_number( ) that takes an input n and returns TRUE if n is a perfect number and FALSE otherwise. If n is not a positive whole number, then it should throw an error with the exact message: \"n is not a positive integer.\
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
