In: Computer Science
Pell's sequence is the following infinite sequence: 0,
1, 2, 5, 12, 29, 70, 169, 408, 985, 2378 ...
first element is 0, the second is 1 and each remaining element is
the sum of twice the previous element plus
the element before the previous one.
(a) Write a function that receives an integer and return the Pell
number in that position. By
For example, if the input is 2, the output must be 1, if the input
is 5, the output must be 12. Present proof of
desktop and its respective PrtScr for inputs: 1, 2 and 7.
(b) Write a function that receives a number and returns the Pell
number closest to the value entered.
For example, if the input is 20 the output must be 12, if the input
is 21 the output must be 29, if the input is 20.5
the output must be 12. Present desktop tests and their respective
PrtScr for inputs: 49.4, 49.5, 49.6.
PHYTON