#K55697. Special Summation Sequence
Special Summation Sequence
Special Summation Sequence
You are given a sequence defined as follows:
- \(a_1 = 1\) and \(a_2 = 2\)
- For \(n > 2\), \(a_n = a_1 + a_2 + \cdots + a_{n-1}\).
Your task is to compute the \(n\)th term of this sequence.
Examples:
Input: 3 Output: 3</p>Input: 5 Output: 12
Input: 7 Output: 48
Note: Use precise arithmetic as the sequence may grow quickly.
inputFormat
The input consists of a single line containing one integer \(n\) (\(n \geq 1\)), representing the position in the sequence you are required to compute.
outputFormat
Output a single integer: the value of the \(n\)th term in the sequence.
## sample1
1