Problem
We are required to write a JavaScript function that takes in a number n as the only input. Suppose a sequence u for which,
u1 = 0 and u1 = 2
Our function should find the of un for which,
6unun+1- 5unun+2+un+1un+2 = 0
Example
Following is the code −
const num = 13;
const sequenceSum = (num = 1) => {
const res = Math.pow(2, num);
return res;
};
console.log(sequenceSum(num));Output
8192