Question: a sumac sequence, t 1 , t 2 , . . , tm , each term is an integer greater than or equal 0 .
a sumac sequence, t t tm each term is an integer greater than or equal Also, eachterm, starting with the third, is the difference of the preceding two terms that is tn tn tn for n The sequence terminates at tm if tm tm For example, if we have and then the sumac sequence generated is as follows:This is a sumac sequence of length Input SpecificationThe input will be two positive numbers t and t with t tOutput SpecificationThe output will be the length of the sumac sequence given by the starting numbers t and tSample InputOutput for Sample InputPart marks: Solve the problem with a iterative solutionPart marks: Solve the problem with a recursive solution
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
