Question: 1. This problem concerns the Padovan sequence. The first few elements of the sequence are 11 1 2 2 3 4 5 7 9
1. This problem concerns the Padovan sequence. The first few elements of the sequence are 11 1 2 2 3 4 5 7 9 12 16 21, ... The sequence is defined as PAD(n+1) - PAD(n 1) +PAD(n 2) with PAD(0) - PAD (1) - PAD(2) - 1. Write a single LISP function, called PAD, that takes a single integer argument N, and returns the Nth Padovan number. For example (PAD 5) returns 3, (PAD 3) returns 2, and (PAD 4) returns 2. Test your program on at least the first 10 Padovan numbers. Also test your program for larger values of N. What happens? Explain why in your hw1.txt file.
Step by Step Solution
3.42 Rating (142 Votes )
There are 3 Steps involved in it
Heres a Lisp function called PAD that calculates the Nth Padovan number lisp defun PAD n cond n 0 1 ... View full answer
Get step-by-step solutions from verified subject matter experts
