Recurrence sequence
InterviewTime limit5sMemory limit512 MB
Compute the n-th term of a self-convolution recurrence where t(n) sums t(i)*t(n-1-i) for i from 0 to n-1, with n up to 35.
- Level
Easy3 of 10
- Topics
- Dynamic programming, Math, Combinatorics, Implementation
- Solved
- No attempts yet
Problem
Consider the sequence defined by the following recurrence.
- for
Applying the definition directly gives , , and .
Given an integer , write a program that prints .
Input
The first line contains an integer ().
Output
Print on the first line. Every value up to fits in a signed 64-bit integer.