#K61552. Find the M-th Term in a Special Sequence
Find the M-th Term in a Special Sequence
Find the M-th Term in a Special Sequence
You are given a positive integer m and asked to find the m-th term of a special sequence defined as follows:
- \(T(1)=3\), \(T(2)=5\), \(T(3)=11\), and \(T(4)=21\).
- For \(m \geq 5\), the sequence is defined by the recurrence relation:
\(T(m)=T(m-1)+2\times T(m-2)\)
Your task is to write a program that reads the integer m from standard input and prints the m-th term on standard output.
inputFormat
The input consists of a single line containing one integer m (\(1 \le m \le 10^9\)).
outputFormat
Output a single integer, which is the m-th term of the sequence.
## sample1
3
</p>