Question: LISP Programming: Sequences and Functions / Fibonacci Prime Mainly need help with writing the higher order-function in LISP to find the 5th Fibonacci Prime 1.

LISP Programming: Sequences and Functions / Fibonacci Prime

Mainly need help with writing the higher order-function in LISP to find the 5th Fibonacci Prime

LISP Programming: Sequences and Functions / Fibonacci Prime Mainly need help with

1. So far this semester, we have written several functions which find the nth number in a sequence which satisfies some property (e.g. the nth even number). It would be helpful if we wrote a higher order function which could take a function which generated the sequence and a function which tested for the property in which we are interested as well as the integer n and returned the nh value in that sequence which satisfied the property (i.e. the test function returns true when passed that value). (a) Write a function, named find, which takes three parameters (sequence, a function; test, a function and n, a positive integer) and returns thenth value in sequence for which the test function returns true (#t) when passed a value in sequence. (sequence k) should return the kth element of the sequence. (test x) should return #t if the property holds for x, #f otherwise. your results. to find the 5th Fibonacci prime. Remember the "smooth" code from the lecture slides. (b) Test your program with by finding the 15th even number and the 15th odd number. Verify (c) A Fibonacci prime is a Fibonacci number which is prime. Use your higher-order function 1. So far this semester, we have written several functions which find the nth number in a sequence which satisfies some property (e.g. the nth even number). It would be helpful if we wrote a higher order function which could take a function which generated the sequence and a function which tested for the property in which we are interested as well as the integer n and returned the nh value in that sequence which satisfied the property (i.e. the test function returns true when passed that value). (a) Write a function, named find, which takes three parameters (sequence, a function; test, a function and n, a positive integer) and returns thenth value in sequence for which the test function returns true (#t) when passed a value in sequence. (sequence k) should return the kth element of the sequence. (test x) should return #t if the property holds for x, #f otherwise. your results. to find the 5th Fibonacci prime. Remember the "smooth" code from the lecture slides. (b) Test your program with by finding the 15th even number and the 15th odd number. Verify (c) A Fibonacci prime is a Fibonacci number which is prime. Use your higher-order function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!