Home /
Expert Answers /
Computer Science /
solve-in-python-given-the-first-x-numbers-find-the-nth-number-of-a-series-using-recursion-pa320
(Solved): solve in python
Given the first \( x \) numbers, find the nth number of a series, using recursion, ...
solve in python
Given the first \( x \) numbers, find the nth number of a series, using recursion, where the next number is the sum of the previous \( y \). Input Format The first line contains three space separated integers, \( n, x \) and \( y \). The second line contains \( x \) space separated integers, the terms of the series. Constraints \[ \begin{array}{l} 1<=n<=20 \\ 1<=x<=20 \\ 1<=y<=x \end{array} \] Output Format Output a single integer, the nth number of the series Sample Input 0 432 O 11 Sample Output 0 2 Sample Input 1 \[ \begin{array}{l} 433 \\ 123 \\ \end{array} \] Sample Output 1 6